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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 60px;
    padding-bottom: 80px;
}

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

/* Top Banner */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.banner-text {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.whatsapp-icon {
    width: 40px;
    height: 40px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s;
    text-decoration: none;
}

.whatsapp-icon:hover {
    transform: scale(1.1);
}

/* Main Menu */
.app-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.menu-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.menu-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.menu-icon {
    font-size: 32px;
}

.menu-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

/* Sections */
.section {
    animation: fadeIn 0.3s ease-in;
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Back Button */
.back-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    transition: all 0.2s;
}

.back-button:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

/* Class/Group Select */
.class-select {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.class-select h3 {
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.select-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.select-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Calculator */
.calculator {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.calculator h3 {
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

.subject-group {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.subject-group h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.input-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.input-row label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.input-row input {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.input-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Date Input */
.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.date-separator {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-secondary);
}

/* Calculate Button */
.calculate-button {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.calculate-button:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Result Box */
.result {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid var(--border-color);
}

.result-stats {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.result-stats h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-total {
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
}

.result-total-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-total-value {
    font-size: 32px;
    font-weight: bold;
}

.result-grade {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
}

.result-grade.excellent {
    background: #D1FAE5;
    color: #065F46;
}

.result-grade.very-good {
    background: #DBEAFE;
    color: #1E40AF;
}

.result-grade.good {
    background: #FEF3C7;
    color: #92400E;
}

.result-grade.sufficient {
    background: #FED7AA;
    color: #9A3412;
}

.result-grade.weak {
    background: #FEE2E2;
    color: #991B1B;
}

/* Info Box */
.info-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.info-text {
    font-size: 18px;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.info-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Links */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.link-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.link-icon {
    font-size: 24px;
}

.link-text {
    font-size: 14px;
    font-weight: 600;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

.install-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
}

.install-button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* iOS Install Banner */
.ios-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: slideInUp 0.5s ease;
}

.ios-banner-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.ios-banner-close {
    position: absolute;
    top: -10px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ios-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ios-banner-icon {
    float: left;
    margin-right: 15px;
}

.ios-banner-text h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
}

.ios-banner-text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
}

.ios-instructions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ios-step svg {
    flex-shrink: 0;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .app-title {
        font-size: 24px;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .banner-text {
        font-size: 12px;
    }
    
    .whatsapp-icon {
        width: 35px;
        height: 35px;
    }
    
    .date-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-separator {
        display: none;
    }
}

/* Print Styles */
@media print {
    .top-banner,
    .back-button,
    .calculate-button,
    .install-prompt,
    .ios-info {
        display: none !important;
    }
}
