/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Main content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Calculator section */
.calculator-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* State selection */
.state-selection {
    margin-bottom: 30px;
    text-align: center;
}

.state-selection h2 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.state-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.state-btn {
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #4a5568;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.state-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.state-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.state-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.subjects-container h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.subject-inputs {
    margin-bottom: 20px;
}

.subject-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    position: relative;
}

.subject-select,
.grade-select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.subject-select:focus,
.grade-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.remove-subject {
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #ff6b6b;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-subject:hover {
    background: #ff5252;
    transform: translateY(-50%) scale(1.1);
}

.add-subject-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-subject-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Calculation section */
.calculation-section {
    margin-top: 30px;
}

.calculate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(79, 172, 254, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.result-container {
    animation: fadeInUp 0.5s ease;
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.result-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.atar-score {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.atar-description {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Info section */
.info-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.info-section h2 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.info-card {
    background: #f8fafc;
    padding: 25px;
    border-radius: 16px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.info-card p {
    color: #4a5568;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .calculator-section,
    .info-section {
        padding: 20px;
    }
    
    .subject-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .remove-subject {
        position: static;
        transform: none;
        align-self: flex-end;
        margin-top: 10px;
    }
    
    .atar-score {
        font-size: 3rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .calculator-section,
    .info-section {
        padding: 15px;
    }
    
    .subject-select,
    .grade-select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .atar-score {
        font-size: 2.5rem;
    }
}

/* Loading state */
.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.calculate-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Success/Error states */
.result-card.success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.result-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.result-card.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
