* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #4facfe 100%);
    color: white;
    text-align: center;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
    to { text-shadow: 0 2px 20px rgba(255, 255, 255, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2); }
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.input-section, .chart-section, .trends-section, .scores-section {
    padding: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.scores-section {
    border-bottom: none;
}

.input-section {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.02) 0%, rgba(0, 242, 254, 0.02) 100%);
}

h2 {
    color: #2d3748;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 2px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.button-center {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="date"], input[type="number"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="date"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

input[type="date"]:hover, input[type="number"]:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

#scoreChart {
    max-height: 400px;
    margin: 30px 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: white;
    padding: 20px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.score-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.score-info {
    flex-grow: 1;
}

.score-date {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.score-value {
    font-size: 1.2rem;
    color: #4facfe;
    font-weight: bold;
}

.score-percentage {
    font-size: 0.9rem;
    color: #666;
}

.score-actions {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edit-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

/* Alert Modal Styles */
.alert-modal, .confirm-modal {
    text-align: center;
    max-width: 400px;
    padding: 40px 30px;
}

.alert-icon, .confirm-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.alert-modal h3, .confirm-modal h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.alert-modal p, .confirm-modal p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.5;
}

.alert-buttons, .confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.alert-btn, .confirm-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.alert-btn {
    background: #4facfe;
    color: white;
}

.alert-btn:hover {
    background: #3a8bfe;
}

.yes-btn {
    background: #28a745;
    color: white;
}

.yes-btn:hover {
    background: #218838;
}

.no-btn {
    background: #6c757d;
    color: white;
}

.no-btn:hover {
    background: #5a6268;
}

.no-scores {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.05) 100%);
    border-radius: 16px;
    border: 2px dashed #cbd5e0;
    font-size: 1.1rem;
}

/* Trends Section Styles */
.trends-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.trend-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.trend-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.trend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e0;
}

.trend-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.trend-improving::before {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.trend-improving .trend-icon {
    color: #48bb78;
    animation: bounce 2s infinite;
}

.trend-declining::before {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.trend-declining .trend-icon {
    color: #f56565;
    animation: shake 2s infinite;
}

.trend-stable::before {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.trend-stable .trend-icon {
    color: #ed8936;
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.trend-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.trend-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.trend-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.no-trends {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.05) 100%);
    border-radius: 16px;
    border: 2px dashed #cbd5e0;
    font-size: 1.1rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3a8bfe 0%, #00d4fe 100%);
}

/* Enhanced form styling */
.form-group {
    position: relative;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 16px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .input-section, .chart-section, .trends-section, .scores-section {
        padding: 25px 20px;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: unset;
    }
    
    .score-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    
    .score-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .trends-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .trend-card {
        padding: 20px;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 30px 25px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .input-section, .chart-section, .trends-section, .scores-section {
        padding: 20px 15px;
    }
    
    button {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .edit-btn, .delete-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}