/* =====================================
   GLOBAL RESET
===================================== */

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

/* =====================================
   INTRO ANIMATION
===================================== */

.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a6f66 0%, #085e57 30%, #064d47 60%, #0a6f66 100%);
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.intro-content {
    text-align: center;
    z-index: 2;
}

.intro-logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.intro-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 255, 255, 0.2);
    animation: logoFloat 2s ease-in-out infinite, logoAppear 0.8s ease-out forwards;
    position: relative;
    z-index: 2;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(244, 227, 195, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes logoAppear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.intro-title {
    font-size: 24px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    opacity: 0;
    animation: textSlideUp 0.6s ease-out 0.3s forwards;
    letter-spacing: 2px;
}

.intro-subtitle {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
    opacity: 0;
    animation: textSlideUp 0.6s ease-out 0.5s forwards;
    background: linear-gradient(135deg, #ffffff 0%, #f4e3c3 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textSlideUp 0.6s ease-out 0.5s forwards, shimmer 3s ease-in-out infinite;
}

@keyframes textSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.intro-loader {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.4s ease-out 0.7s forwards;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f4e3c3, #ffffff, #f4e3c3);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: loadProgress 2s ease-in-out forwards, loaderShimmer 1s ease-in-out infinite;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes loaderShimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.intro-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.intro-particles::before,
.intro-particles::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 227, 195, 0.15) 0%, transparent 70%);
    animation: particleFloat 8s ease-in-out infinite;
}

.intro-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.intro-particles::after {
    bottom: 20%;
    right: 10%;
    animation-delay: -4s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(30px, -30px) scale(1.2);
        opacity: 0.8;
    }
    50% {
        transform: translate(0, -50px) scale(1);
        opacity: 0.5;
    }
    75% {
        transform: translate(-30px, -30px) scale(1.3);
        opacity: 0.7;
    }
}

/* Mobile Responsive Intro */
@media (max-width: 600px) {
    .intro-logo {
        width: 100px;
        height: 100px;
        padding: 12px;
        border-radius: 16px;
    }
    
    .logo-glow {
        width: 120px;
        height: 120px;
    }
    
    .intro-title {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .intro-subtitle {
        font-size: 24px;
        padding: 0 20px;
    }
    
    .intro-loader {
        width: 150px;
    }
}

:root {
    --gitam-green: #0a6f66;
    --gitam-green-dark: #085e57;
    --gitam-gold: #f4e3c3;
    --gitam-light: #f6f5f2;
    --gitam-ink: #1f2937;
    --gitam-muted: #667085;
    --gitam-border: #e7e2d9;
    --gitam-surface: #ffffff;
    --gitam-soft: #f4ead5;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gitam-light);
    color: var(--gitam-ink);
    line-height: 1.5;
}

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


/* =====================================
   HEADER
===================================== */

.header {
    background: linear-gradient(135deg, var(--gitam-green) 0%, #0b7a71 100%);
    color: white;
    padding: 18px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-area {
    display: flex;
    align-items: center;
}

.gitam-logo {
    height: 42px;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.35);
}

.title-area h1 {
    font-size: 22px;
    font-weight: 600;
}

.title-area p {
    font-size: 13px;
    opacity: 0.9;
}


/* =====================================
   INFO BOX
===================================== */

.info-box {
    background: var(--gitam-soft);
    border-left: 4px solid var(--gitam-green);
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}


/* =====================================
   SUBJECT CARD
===================================== */

.subject-card {
    background: var(--gitam-surface);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--gitam-border);
    transition: all 0.2s ease;
}

.subject-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.subject-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.remove-btn {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.remove-btn:hover {
    background: #d9363e;
}


/* =====================================
   GRID LAYOUT
===================================== */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}


/* =====================================
   INPUTS
===================================== */

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

.input-group label {
    font-size: 13px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

input,
select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--gitam-green);
    box-shadow: 0 0 0 3px rgba(10,111,102,0.15);
}


/* =====================================
   THEORY / PRACTICAL SECTIONS
===================================== */

.theory-section,
.practical-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.theory-section h3,
.practical-section h3 {
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--gitam-green);
    font-weight: 600;
}


/* =====================================
   ACTION BUTTONS
===================================== */

.actions {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    margin-bottom: 25px;
}

button {
    cursor: pointer;
    font-family: inherit;
}

#add-subject-btn {
    background: var(--gitam-soft);
    border: 1px solid var(--gitam-border);
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--gitam-green);
    transition: 0.2s;
}

#add-subject-btn:hover {
    background: #efe2c8;
}

.primary-btn {
    background: var(--gitam-green);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.2s;
    box-shadow: 0 6px 16px rgba(10,111,102,0.25);
}

.primary-btn:hover {
    background: var(--gitam-green-dark);
}


/* =====================================
   RESULT SECTION
===================================== */

.result-section {
    margin-top: 20px;
}

.result-card {
    background: var(--gitam-surface);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--gitam-border);
    margin-bottom: 15px;
}

.result-card p {
    font-size: 14px;
    color: var(--gitam-muted);
}

.result-card h1 {
    font-size: 42px;
    color: var(--gitam-green);
    margin-top: 5px;
    font-weight: 700;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 10px 0 14px;
    color: #111827;
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 4px;
    height: 16px;
    background: var(--gitam-green);
    border-radius: 3px;
}

.table-wrapper {
    background: var(--gitam-surface);
    border-radius: 12px;
    border: 1px solid var(--gitam-border);
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.result-table th,
.result-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gitam-border);
    text-align: left;
    vertical-align: top;
}

.result-table th {
    background: #f9fafb;
    font-weight: 700;
    color: #374151;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.cgpa-card {
    background: var(--gitam-surface);
    border-radius: 12px;
    border: 1px solid var(--gitam-border);
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    padding: 20px;
}

.cgpa-card .primary-btn {
    margin-top: 10px;
}

.cgpa-result {
    margin-top: 16px;
    text-align: center;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
}

.cgpa-result h2 {
    font-size: 28px;
    color: var(--gitam-green);
    margin-top: 6px;
    font-weight: 700;
}

.secondary-btn {
    background: #ffffff;
    color: var(--gitam-green);
    border: 1px solid var(--gitam-green);
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.2s;
}

.secondary-btn:hover {
    background: #f0f7f6;
}


/* =====================================
   FOOTER
===================================== */

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: var(--gitam-muted);
    font-size: 13px;
}


/* =====================================
   UTILITY
===================================== */

.hidden {
    display: none;
}


/* =====================================
   RESPONSIVE DESIGN
===================================== */

@media (max-width: 900px) {

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
        gap: 10px;
    }

    .primary-btn,
    #add-subject-btn {
        width: 100%;
    }
}

@media (max-width: 700px) {

    .container {
        padding: 16px;
    }

    .subject-card,
    .result-card,
    .cgpa-card {
        padding: 18px;
    }

    .result-card h1 {
        font-size: 34px;
    }

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

    .result-table {
        min-width: 600px;
    }
}

@media (max-width: 420px) {

    .title-area h1 {
        font-size: 18px;
    }

    .title-area p {
        font-size: 12px;
    }

    input,
    select {
        font-size: 13px;
    }
}
