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

html, body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f7f5f3 0%, #e8f5e8 50%, #d4edd9 100%);
    min-height: 100vh;
    color: #2d5016;
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

body {
    width: 100%;
    max-width: 100vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

/* Header */
.header {
    text-align: center;
    color: #2d5016;
    margin-bottom: 3rem;
}

.header-content {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid rgba(45, 80, 22, 0.1);
    box-shadow: 0 8px 32px rgba(45, 80, 22, 0.1);
}

.header-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #6b8e3d;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d5016;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 400;
    color: #5a7c32;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    align-items: center;
}

/* Upload section */
.upload-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.upload-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 12px 24px rgba(45, 80, 22, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(107, 142, 61, 0.2);
    margin: 0 auto;
}

.upload-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(45, 80, 22, 0.15);
}

.upload-area {
    padding: 3rem;
    text-align: center;
    border: 2px dashed #a8b88a;
    margin: 1.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(248, 250, 247, 0.5);
}

.upload-area:hover {
    border-color: #6b8e3d;
    background: rgba(107, 142, 61, 0.05);
}

.upload-area.dragover {
    border-color: #6b8e3d;
    background: rgba(107, 142, 61, 0.1);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3rem;
    color: #6b8e3d;
    margin-bottom: 1rem;
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #2d5016;
}

.upload-area p {
    color: #5a7c32;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.upload-btn {
    background: linear-gradient(135deg, #6b8e3d 0%, #5a7c32 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(107, 142, 61, 0.3);
}

/* File info */
.file-info {
    padding: 2rem;
    background: #f8faff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
    color: #dc2626;
}

.file-text {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: #334155;
}

.file-size {
    font-size: 0.9rem;
    color: #64748b;
}

.calculate-btn {
    background: linear-gradient(135deg, #8b5a3c 0%, #6d4c41 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 90, 60, 0.3);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results section */
.results-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 2rem;
    width: 100%;
}

.results-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 16px 32px rgba(45, 80, 22, 0.12);
    padding: 2.5rem;
    width: 100%;
    max-width: 1000px;
    border: 1px solid rgba(107, 142, 61, 0.15);
    text-align: center;
    margin: 0 auto;
}

.results-card h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #2d5016;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.results-card h2 i {
    color: #6b8e3d;
}

/* GPA Filter Buttons */
.gpa-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(107, 142, 61, 0.1);
    color: #2d5016;
    border: 2px solid rgba(107, 142, 61, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.filter-btn:hover {
    background: rgba(107, 142, 61, 0.15);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #6b8e3d 0%, #5a7c32 100%);
    color: white;
    border-color: #6b8e3d;
}

.filter-btn i {
    font-size: 0.9rem;
}

/* GPA display */
.gpa-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gpa-item {
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(248, 250, 247, 0.8) 0%, rgba(232, 245, 232, 0.6) 100%);
    border-radius: 20px;
    border: 2px solid rgba(107, 142, 61, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gpa-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(107, 142, 61, 0.15);
}

.gpa-value {
    font-size: 3rem;
    font-weight: 700;
    color: #6b8e3d;
    margin-bottom: 0.5rem;
}

.gpa-value.percentage {
    color: #8b5a3c;
}

.gpa-label {
    font-size: 1rem;
    font-weight: 600;
    color: #2d5016;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.gpa-description {
    font-size: 0.85rem;
    color: #5a7c32;
    font-weight: 400;
    opacity: 0.8;
}

/* Summary stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: rgba(248, 250, 247, 0.7);
    border-radius: 16px;
    border: 1px solid rgba(107, 142, 61, 0.2);
}

.stat-item i {
    font-size: 1.5rem;
    color: #6b8e3d;
}

.stat-label {
    font-weight: 500;
    color: #2d5016;
}

.stat-value {
    font-weight: 700;
    color: #2d5016;
    margin-left: auto;
}

/* Courses section */
.courses-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.courses-section h3 i {
    color: #667eea;
}

.courses-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.courses-table th,
.courses-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.courses-table th {
    background: #f8faff;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.courses-table tr:hover {
    background: #f8faff;
}

.courses-table td:last-child {
    font-weight: 600;
    color: #667eea;
}

/* Failed course styling */
.courses-table tr.failed-course {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
}

.courses-table tr.failed-course:hover {
    background-color: #fee2e2;
}

.failed-status {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.9rem;
}

.passed-status {
    color: #10b981;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Reset button */
.reset-btn {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(100, 116, 139, 0.3);
}

/* Error section */
.error-section {
    display: flex;
    justify-content: center;
}

.error-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.error-icon {
    font-size: 4rem;
    color: #dc2626;
    margin-bottom: 1.5rem;
}

.error-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #334155;
}

.error-card p {
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    color: rgba(45, 80, 22, 0.7);
}

.footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.footer i {
    color: #6b8e3d;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header-content {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .gpa-display {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .file-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .gpa-value {
        font-size: 2.5rem;
    }
    
    .courses-table {
        font-size: 0.9rem;
    }
    
    .courses-table th,
    .courses-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .results-card {
        padding: 1.5rem;
    }
    
    .gpa-value {
        font-size: 2rem;
    }
    
    .courses-table {
        font-size: 0.8rem;
    }
}
