/* 
    IIH Admission Portal - Glassmorphism UI 
    GIGW Accessible Design
*/

:root {
    /* Color Palette */
    --wine-red: #9e0c0f;
    --wine-dark: #722f37;
    --golden-flat: #d4af37;
    --golden-light: #f4e3b1;
    --bg-light: #fdfbf7;
    --text-main: #2d2a26;
    --text-muted: #6b6762;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 8px 32px rgba(114, 47, 55, 0.08);
    --shadow-hover: 0 12px 40px rgba(158, 12, 15, 0.15);
    --error-red: #c20a0e;
    --success-green: #2e7d32;
    --border-light: #e5e5e5;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Subtle Gradient Mesh Background */
.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.05), transparent 40%),
                radial-gradient(circle at 85% 30%, rgba(158, 12, 15, 0.06), transparent 50%);
    background-color: var(--bg-light);
}

.portal-wrapper {
    margin: 0 auto;
    padding: 2rem 0;
}

/* DBIM Immersive Header & Footer */
.accessibility-bar {
    border-bottom: 2px solid var(--golden-flat);
}

.dbim-header {
    border-bottom: 4px solid var(--wine-red);
}

.dbim-footer {
    background: #1e293b; /* Deep Blue typical of Gov sites */
    color: #fff;
}

.footer-top-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--golden-flat) 0%, var(--wine-red) 100%);
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover, .footer-links a:focus {
    color: #fff;
    text-decoration: underline;
}

/* GIGW High Contrast Mode Overrides */
body.high-contrast-mode,
body.high-contrast-mode .glass-background,
body.high-contrast-mode .minimal-section,
body.high-contrast-mode .glass-card,
body.high-contrast-mode .dbim-header {
    background: #000 !important;
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.high-contrast-mode h1, 
body.high-contrast-mode h2, 
body.high-contrast-mode h3, 
body.high-contrast-mode h4, 
body.high-contrast-mode h5, 
body.high-contrast-mode h6,
body.high-contrast-mode .dbim-brand-text div,
body.high-contrast-mode .text-muted,
body.high-contrast-mode label,
body.high-contrast-mode .fw-bold {
    color: #ff0 !important; /* Yellow text for high contrast */
}

body.high-contrast-mode a,
body.high-contrast-mode .btn-glass-secondary {
    color: #0ff !important; /* Cyan links */
    border-color: #0ff !important;
}

body.high-contrast-mode .btn-glass-primary {
    background: #0ff !important;
    color: #000 !important;
}

body.high-contrast-mode .sidebar-nav {
    background: #000 !important;
    border: 2px solid #fff;
}

body.high-contrast-mode .sidebar-nav-item.active {
    background: #ff0 !important;
    color: #000 !important;
}

body.high-contrast-mode .form-control,
body.high-contrast-mode .form-select {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.glass-header {
    background: var(--wine-red);
    border-bottom: 3px solid var(--golden-flat);
    padding: 0.8rem 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.glass-header h3, .glass-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(232, 201, 106, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--golden-light);
    font-weight: 700;
    flex-shrink: 0;
}

/* Sections & Panels */
.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

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

.minimal-section {
    margin-bottom: 2rem;
}

.minimal-section-title {
    font-family: 'Cormorant Garamond', serif;
    color: var(--wine-red);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid var(--golden-light);
    padding-bottom: 0.5rem;
}

/* Typography */
h1, h2, h3, .serif-heading {
    font-family: 'Cormorant Garamond', serif;
}

/* Forms & Inputs (GIGW) */
.form-control, .form-select, textarea {
    border-radius: 8px;
    border: 1.5px solid var(--border-light);
    padding: 0.6rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    width: 100%;
}

.form-control:focus, .form-select:focus, textarea:focus {
    outline: none;
    border-color: var(--wine-red);
    box-shadow: 0 0 0 3px rgba(158, 12, 15, 0.1);
}

.has-error .form-control, .has-error .form-select, .has-error textarea {
    border-color: var(--error-red);
}

.ferr {
    font-size: 12px;
    color: var(--error-red);
    display: none;
    margin-top: 4px;
}

.has-error .ferr {
    display: block;
}

.form-label, label {
    font-weight: 600;
    color: var(--wine-dark);
    margin-bottom: 0.4rem;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: block;
}

.req {
    color: var(--error-red);
    margin-left: 3px;
}

/* Buttons */
.btn-glass-primary {
    background: var(--wine-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.8rem;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(158, 12, 15, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-glass-primary:hover:not(:disabled) {
    background: var(--wine-dark);
    transform: translateY(-1px);
    color: #fff;
    box-shadow: 0 6px 16px rgba(158, 12, 15, 0.3);
}

.btn-glass-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-glass-secondary {
    background: #fff;
    color: var(--wine-red);
    border: 1.5px solid var(--wine-red);
    border-radius: 8px;
    padding: 0.6rem 1.8rem;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-glass-secondary:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--wine-dark);
}

/* Radio Pills */
.rpills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 4px;
}

.rpill {
    padding: 0.4rem 1rem;
    border: 1.5px solid var(--border-light);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: #fff;
}

.rpill:hover {
    border-color: var(--wine-red);
}

.rpill.sel {
    border-color: var(--wine-red);
    background: var(--wine-red);
    color: #fff;
}

/* Step Indicators (Stepper) */
.stepper-container {
    padding: 1.5rem 0 2.5rem;
}

.stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.step-line-container {
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 80px;
    cursor: pointer;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 14px;
}

.step.active .step-circle {
    background: var(--wine-red);
    border-color: var(--wine-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(158, 12, 15, 0.3);
}

.step.done .step-circle {
    background: var(--success-green);
    border-color: var(--success-green);
    color: #fff;
}

.step-label {
    margin-top: 0.6rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.3s;
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--wine-red);
    font-weight: 700;
}

.step.done .step-label {
    color: var(--success-green);
}

.step-indicator-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Programme & Centre Cards */
.programme-card, .centre-card {
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.programme-card:hover, .centre-card:hover {
    border-color: var(--wine-red);
    background: rgba(158, 12, 15, 0.02);
    box-shadow: 0 4px 12px rgba(158, 12, 15, 0.08);
}

.programme-card.sel, .centre-card.sel {
    border-color: var(--wine-red);
    background: rgba(158, 12, 15, 0.05);
}

.card-icon-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: transparent;
    transition: all 0.2s;
}

.sel .card-icon-circle {
    border-color: var(--wine-red);
    background: var(--wine-red);
    color: #fff;
}

.isProgrammeSelectedBox {
    background: var(--golden-flat);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Tables */
.qtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.qtable th {
    background: rgba(158, 12, 15, 0.05);
    color: var(--wine-dark);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.6rem;
    border: 1px solid var(--border-light);
    text-align: left;
}

.qtable td {
    border: 1px solid var(--border-light);
    padding: 0;
}

.qtable td input {
    border: none;
    padding: 0.6rem;
    width: 100%;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    background: transparent;
    color: var(--text-main);
}

.qtable td input:focus {
    outline: none;
    background: rgba(158, 12, 15, 0.02);
}

.qtable tr:nth-child(even) td {
    background: #fafafa;
}

.qlabel {
    background: rgba(158, 12, 15, 0.02) !important;
    font-weight: 600;
    color: var(--wine-dark);
    padding: 0.6rem !important;
    font-size: 12px;
    white-space: nowrap;
}

/* Upload Box */
.upbox {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-light);
}

.upbox:hover {
    border-color: var(--wine-red);
    background: rgba(158, 12, 15, 0.02);
}

.upbox.hasfile {
    border-color: var(--success-green);
    background: rgba(46, 125, 50, 0.05);
    border-style: solid;
}

.upicon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.hasfile .upicon {
    color: var(--success-green);
}

.upprev {
    margin-top: 0.8rem;
    padding: 0.6rem 1rem;
    background: rgba(46, 125, 50, 0.05);
    border: 1px solid var(--success-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    color: var(--success-green);
    font-weight: 500;
}

/* Word Count Bar */
.wbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.wprog {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-right: 12px;
    overflow: hidden;
}

.wfill {
    height: 100%;
    border-radius: 2px;
    background: var(--wine-red);
    transition: width 0.3s;
}

.wfill.warn {
    background: var(--golden-flat);
}

.wfill.over {
    background: var(--error-red);
}

/* Declaration Box */
.declbox {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-left: 4px solid var(--golden-flat);
    border-radius: 0 12px 12px 0;
    padding: 1.5rem;
    font-size: 14px;
    line-height: 1.6;
}

.drow {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    align-items: flex-start;
}

.dnum {
    background: var(--wine-dark);
    color: #fff;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
    flex-shrink: 0;
}

.dagree {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--wine-red);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dagree:hover {
    background: var(--wine-dark);
}

.dacheck {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dagree.agreed .dacheck {
    background: var(--golden-flat);
    border-color: var(--golden-flat);
    color: var(--wine-dark);
}

.dagree span {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* Fee Row */
.feerow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: rgba(158, 12, 15, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.feec {
    font-size: 14px;
}

.feec span {
    font-weight: 700;
    color: var(--wine-red);
}

/* OTP Modal */
.otp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-modal {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.otp-modal h3 {
    color: var(--wine-dark);
    margin-bottom: 0.5rem;
}

.otp-input {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.otp-input input {
    width: 48px;
    height: 56px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-light);
}

.otp-input input:focus {
    border-color: var(--wine-red);
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 12, 15, 0.1);
}

/* Utility Classes */
.transition-all {
    transition: all 0.3s ease;
}

.text-wine { color: var(--wine-red) !important; }
.bg-wine { background-color: var(--wine-red) !important; color: #fff !important; }
.bg-wine-light { background-color: rgba(158, 12, 15, 0.05) !important; }
.border-wine { border-color: var(--wine-red) !important; }
.text-golden { color: var(--golden-flat) !important; }

/* Sidebar Nav */
.sidebar-nav {
    position: sticky;
    top: 100px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.sidebar-nav-title {
    font-weight: 700;
    color: var(--wine-dark);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--golden-light);
    padding-bottom: 0.5rem;
}

.sidebar-nav-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.sidebar-nav-item:hover, .sidebar-nav-item:focus {
    background: rgba(158, 12, 15, 0.05);
    color: var(--wine-red);
}

.sidebar-nav-item.active {
    background: var(--wine-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(158, 12, 15, 0.2);
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
    .feerow {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portal-wrapper {
        padding: 1rem 0;
    }
    
    .glass-card {
        border-radius: 12px;
    }
    
    .glass-header {
        padding: 1rem;
    }
    
    .stepper {
        justify-content: space-between;
    }
    
    .step-label {
        display: none; /* Hide text on mobile to save space */
    }
    
    .step-line-container {
        left: 20px;
        right: 20px;
    }
    
    .qtable-wrapper {
        overflow-x: auto;
    }
    
    .drow {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .sidebar-nav {
        position: static;
        margin-bottom: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .glass-background,
    .accessibility-bar,
    .dbim-footer,
    .stepper-container,
    .sidebar-nav,
    .navbar,
    .btn {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
    }
    
    .glass-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .glass-header {
        background: #f0f0f0 !important;
        color: #000 !important;
        border-bottom: 1px solid #ccc !important;
    }
    
    .panel {
        display: block !important;
        opacity: 1 !important;
    }
}