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

:root {
    --ucsi-red: #CC0000;
    --ucsi-red-hover: #B30000;
    --ucsi-blue: #003DA5;
    --ucsi-blue-hover: #002D7A;
    --ucsi-yellow: #FFD700;
    --ucsi-yellow-hover: #FFC700;
    --ucsi-white: #FFFFFF;
    --primary-color: #CC0000;
    --primary-hover: #B30000;
    --secondary-color: #003DA5;
    --secondary-hover: #002D7A;
    --accent-color: #FFD700;
    --accent-hover: #FFC700;
    --danger-color: #CC0000;
    --danger-hover: #B30000;
    --success-color: #10b981;
    --warning-color: #FFD700;
    --background: #F5F7FA;
    --surface: #FFFFFF;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #E0E5EB;
    --shadow-sm: 0 2px 4px 0 rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 12px -1px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 12px 24px -3px rgb(0 0 0 / 0.15);
    --radius: 0.75rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #F5F7FA 0%, #E8EDF3 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--ucsi-red) 0%, var(--ucsi-blue) 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--ucsi-yellow);
    opacity: 0.1;
    border-radius: 50%;
}

.header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--ucsi-white);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.125rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.header .university-badge {
    display: inline-block;
    background: var(--ucsi-yellow);
    color: var(--ucsi-blue);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.875rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
    }
}

.calculator-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
}

.input-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.semesters-container {
    margin-bottom: 2rem;
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.125rem;
}

.semester-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFB 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.semester-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, var(--ucsi-red) 0%, var(--ucsi-blue) 100%);
    transition: width 0.3s ease;
}

.semester-card:hover {
    border-color: var(--ucsi-red);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.semester-card:hover::before {
    width: 6px;
}

.semester-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.semester-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.semester-number {
    background: linear-gradient(135deg, var(--ucsi-red) 0%, var(--ucsi-blue) 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--ucsi-yellow);
}

.semester-gpa {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.semester-gpa strong {
    color: var(--ucsi-red);
    font-size: 1.25rem;
    margin-left: 0.5rem;
    font-weight: 700;
}

.semester-controls {
    display: flex;
    gap: 0.5rem;
}

.courses-list {
    margin-bottom: 1rem;
}

.course-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .course-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--surface);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.btn-remove {
    padding: 0.75rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    height: fit-content;
    align-self: end;
}

.btn-remove:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

.add-course-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.results-section {
    background: linear-gradient(135deg, var(--ucsi-red) 0%, var(--ucsi-blue) 50%, var(--ucsi-blue-hover) 100%);
    border-radius: var(--radius);
    padding: 2.5rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.results-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: var(--ucsi-yellow);
    opacity: 0.08;
    border-radius: 50%;
}

.results-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: var(--ucsi-white);
    opacity: 0.05;
    border-radius: 50%;
}

.result-card {
    text-align: center;
    margin-bottom: 2rem;
}

.result-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    opacity: 0.95;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.cgpa-display {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--ucsi-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grade-scale {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--ucsi-yellow);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ucsi-yellow);
}

.info-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    height: fit-content;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ucsi-red) 0%, var(--ucsi-yellow) 50%, var(--ucsi-blue) 100%);
}

.info-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    color: var(--ucsi-blue);
    font-weight: 700;
}

.grade-table {
    overflow-x: auto;
}

.grade-table table {
    width: 100%;
    border-collapse: collapse;
}

.grade-table th,
.grade-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.grade-table th {
    background: linear-gradient(135deg, var(--ucsi-red) 0%, var(--ucsi-blue) 100%);
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grade-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(204, 0, 0, 0.05) 0%, rgba(0, 61, 165, 0.05) 100%);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.handbook-ref {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--background);
    border-left: 3px solid var(--ucsi-blue);
    border-radius: 0.25rem;
    line-height: 1.6;
}

.footer {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--ucsi-blue) 0%, var(--ucsi-red) 100%);
    border-radius: var(--radius);
    color: white;
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.footer-text strong {
    color: var(--ucsi-yellow);
    font-weight: 700;
}

.footer-disclaimer {
    font-size: 0.75rem;
    opacity: 0.85;
    font-style: italic;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-copyright {
    font-size: 0.75rem;
    margin-top: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .calculator-section,
    .info-section {
        padding: 1.5rem;
    }
    
    .cgpa-display {
        font-size: 2.5rem;
    }
    
    .footer {
        padding: 1.5rem;
        margin-top: 2rem;
    }
}
