/* --- Base Styles & Color Variables --- */
:root {
    --primary-color: #2E7D32;
    --secondary-color: #00897b;
    --danger-color: #c0392b;

    /* Light Mode */
    --background-light: #fafbfc;
    --card-background-light: #ffffff;
    --text-color-light: #1a1a1a;
    --text-muted-light: #666666;
    --border-color-light: #e5e7eb;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
    --header-footer-bg-light: #ffffff;
    --header-footer-border-light: #e5e7eb;

    /* Dark Mode (Neutral Grey) */
    --background-dark: #0f1117;
    --card-background-dark: #161b22;
    --text-color-dark: #c9d1d9;
    --text-muted-dark: #8b949e;
    --border-color-dark: #30363d;
    --shadow-dark: 0 1px 3px rgba(0, 0, 0, 0.3);
    --header-footer-bg-dark: #161b22;
    --header-footer-border-dark: #30363d;
}

body { 
    --bg-color: var(--background-light); 
    --card-bg: var(--card-background-light); 
    --text-color: var(--text-color-light); 
    --text-muted: var(--text-muted-light); 
    --border-color: var(--border-color-light); 
    --shadow: var(--shadow-light);
    --header-footer-bg: var(--header-footer-bg-light);
    --header-footer-border: var(--header-footer-border-light);
}

body.dark-mode {
    --bg-color: var(--background-dark); 
    --card-bg: var(--card-background-dark); 
    --text-color: var(--text-color-dark); 
    --text-muted: var(--text-muted-dark); 
    --border-color: var(--border-color-dark); 
    --shadow: var(--shadow-dark);
    --header-footer-bg: var(--header-footer-bg-dark);
    --header-footer-border: var(--header-footer-border-dark);
}

html { font-size: 70%; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #fafbfc 0%, #f0f8f5 100%);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 130px; /* Offset for fixed header */
    padding-bottom: 50px; /* Offset for fixed footer */
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden; /* Prevent horizontal scroll */
    position: relative; /* For stacking contexts if needed */
}

body.dark-mode {
    background: linear-gradient(135deg, #0f1117 0%, #0d1922 100%);
}

/* --- Header and Footer --- */
.page-header {
    background-color: var(--header-footer-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1010;
    border-bottom: 1px solid var(--header-footer-border);
}
.header-main { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 80px; 
}
.logo-link { 
    text-decoration: none; 
    color: inherit; 
}
.logo-container { 
    display: flex; 
    align-items: center; 
}
.logo-img { 
    height: 50px; 
    margin-right: 15px; 
}
.logo-text {
    font-size: 1.5rem;
    color: #00695c;
}
.logo-text strong {
    font-weight: 700;
}
body.dark-mode .logo-text {
    color: #4db8a8;
}
.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
}
@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.header-credit {
    background-color: var(--header-footer-bg);
    color: var(--text-color);
    text-align: center;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    border-top: 1px solid var(--header-footer-border);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .header-credit {
        padding: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        display: inline-block;
        min-width: 100%;
        animation: marquee 35s linear infinite;
    }

    .header-credit a {
        display: inline;
    }

    .hero-section {
        margin-bottom: 2rem;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-text-mobile {
        display: inline;
    }

    .hero-text-full {
        display: none;
    }

    .hero-section h1 {
        font-size: 1rem;
        word-wrap: break-word;
        line-height: 1.2;
    }

    .hero-section p {
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.4;
    }
}

@media (max-width: 450px) {
    .hero-section {
        max-width: 240px;
    }

    .hero-text-mobile {
        display: inline !important;
    }

    .hero-text-full {
        display: none !important;
    }

    .hero-section h1 {
        font-size: 0.9rem;
        line-height: 1.2;
    }
}

.header-credit a {
    color: #1b5e20ff;
    font-weight: 600;
    text-decoration: underline;
    word-break: break-word;
}
.page-footer { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background-color: var(--header-footer-bg); 
    color: var(--text-muted); 
    text-align: center; 
    padding: 0.8rem; 
    font-size: 0.8rem; 
    z-index: 1010; 
    border-top: 1px solid var(--header-footer-border); 
}

/* --- Dark Mode Switch --- */
.dark-mode-switch { 
    position: relative; 
}
.dark-mode-switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
    position: absolute; 
}
.dark-mode-switch label { 
    width: 40px; 
    height: 40px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 100%; 
    background-color: transparent; 
    transition: background-color 0.3s ease; 
}
.dark-mode-switch label:hover { 
    background-color: var(--border-color); 
}
.dark-mode-switch svg { 
    width: 22px; 
    height: 22px; 
    color: var(--text-muted); 
    transition: transform 0.4s ease, opacity 0.4s ease; 
}
.dark-mode-switch .moon { 
    position: absolute; 
    opacity: 0; 
    transform: scale(0) rotate(-90deg); 
}
.dark-mode-switch input:checked + label .sun { 
    opacity: 0; 
    transform: scale(0) rotate(90deg); 
}
.dark-mode-switch input:checked + label .moon { 
    opacity: 1; 
    transform: scale(1) rotate(0deg); 
}

/* --- Homepage Styles --- */
.homepage-container {
    padding: 3rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}
.hero-section {
    margin-bottom: 3rem;
}

.hero-text-mobile {
    display: none;
}

.hero-text-full {
    display: inline;
}
.hero-section h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #2E7D32 0%, #00897b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -1px;
}
body.dark-mode .hero-section h1 {
    background: linear-gradient(135deg, #66bb6a 0%, #4db8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-section p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 500;
}
.features-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem; 
    text-align: left; 
}
.feature-card {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.05) 0%, rgba(0, 137, 123, 0.03) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 137, 123, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(46, 125, 50, 0.15);
    border-color: #2E7D32;
}
body.dark-mode .feature-card:hover {
    box-shadow: 0 12px 24px rgba(102, 187, 106, 0.2);
}
.card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.12) 0%, rgba(0, 137, 123, 0.12) 100%);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.feature-card:hover .card-icon {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.2) 0%, rgba(0, 137, 123, 0.2) 100%);
    transform: scale(1.15) rotate(5deg);
}
body.dark-mode .card-icon {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.15) 0%, rgba(77, 184, 168, 0.15) 100%);
}
.card-icon svg { 
    width: 30px; 
    height: 30px; 
    stroke: var(--primary-color); 
}
body.dark-mode .card-icon svg { 
    stroke: #66bb6a; 
}
.feature-card h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 700;
}
body.dark-mode .feature-card h2 {
    color: #a5d6a7;
}
.feature-card p {
    flex-grow: 1;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.feature-button {
    display: inline-block;
    padding: 13px 32px;
    background: linear-gradient(135deg, #2E7D32 0%, #00897b 100%);
    color: white;
    text-align: center;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
}
.feature-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.4);
    background: linear-gradient(135deg, #1b5e20 0%, #00695c 100%);
}
.feature-button:active {
    transform: translateY(-1px);
}
body.dark-mode .feature-button {
    background: linear-gradient(135deg, #66bb6a 0%, #4db8a8 100%);
    color: #121212;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
}
body.dark-mode .feature-button:hover {
    background: linear-gradient(135deg, #81c784 0%, #64b5a6 100%);
    box-shadow: 0 8px 20px rgba(102, 187, 106, 0.4);
    color: #121212;
}
.feature-card.disabled { 
    opacity: 0.6; 
    pointer-events: none; /* Disable clicks */
}
.feature-card.disabled:hover { 
    transform: none; 
    box-shadow: var(--shadow); 
}
.disabled-button {
    background: linear-gradient(135deg, #a1a1a1 0%, #8b8b8b 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}
.disabled-button:hover {
    background: linear-gradient(135deg, #a1a1a1 0%, #8b8b8b 100%);
    transform: none;
}

/* --- Admit Card Page Layout --- */
.main-content-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    margin-top: 1rem;
}
.page-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Base styles for layout containers (apply to all viewports) */
.initial-view-wrapper,
.preview-view-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 2rem; 
    opacity: 1; 
    visibility: visible; 
    transform: scale(1); 
    /* Combined transition for a smoother effect */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, visibility 0s 0.5s; 
}

.main-content-wrapper.layout-preview-active .initial-view-wrapper { 
    opacity: 0; 
    visibility: hidden; 
    transform: scale(0.95); 
    transition-delay: 0s; 
    pointer-events: none; 
    height: 0; 
    overflow: hidden; 
}
.main-content-wrapper.layout-preview-active .preview-view-wrapper { 
    opacity: 1; 
    visibility: visible; 
    transform: scale(1); 
    transition-delay: 0.3s; /* Delay appearance slightly for smoother transition */
}

/* Specific styling for the actions panel on the admit card page */
.preview-view-wrapper .actions-panel {
    position: static;
    order: -1;
    z-index: auto;
    top: auto;
}

/* --- Mobile Layout --- */
@media (max-width: 991px) {
    .preview-view-wrapper {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        align-items: flex-start;
    }

    .preview-view-wrapper .actions-panel {
        order: -1;
        width: 100%;
        max-width: 500px;
    }

    .preview-admit-card {
        width: 210mm;
        transform: scale(0.5);
        transform-origin: top left;
        margin: 0;
    }
}

/* --- Desktop Layout (wider screens) --- */
@media (min-width: 992px) {
    .initial-view-wrapper {
        grid-template-columns: 1fr 1fr;
        display: grid;
        align-items: stretch;
    }
    .preview-view-wrapper {
        display: grid;
        grid-template-columns: 2fr 1fr;
        align-items: flex-start;
    }

    .preview-view-wrapper .actions-panel {
        position: sticky;
        top: 135px;
        order: unset;
        align-self: flex-start;
    }
}

/* --- Instruction Box Style --- */
.instructions-box-main {
    padding: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.08) 0%, rgba(0, 137, 123, 0.05) 100%);
    border: 2px solid rgba(46, 125, 50, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.1);
    position: relative;
    overflow: visible;
}
body.dark-mode .instructions-box-main {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.12) 0%, rgba(0, 137, 123, 0.08) 100%);
    border: 2px solid rgba(46, 125, 50, 0.3);
}
.instructions-box-main h4 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: #2E7D32;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}
body.dark-mode .instructions-box-main h4 {
    color: #66bb6a;
}
.instructions-box-main h4 svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    stroke: #2E7D32;
    filter: none;
}
body.dark-mode .instructions-box-main h4 svg {
    stroke: #66bb6a;
}
.instructions-box-main ol {
    padding-left: 0;
    margin: 0;
    position: relative;
    z-index: 1;
    list-style: none;
}
.instructions-box-main ol li {
    counter-increment: list-counter;
}
.instructions-box-main li {
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    line-height: 1.55;
    text-align: justify;
    font-weight: 500;
    position: relative;
    padding-left: 20px;
    font-size: 0.92rem;
}
.instructions-box-main li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #2E7D32 0%, #00897b 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(46, 125, 50, 0.4);
    flex-shrink: 0;
}
body.dark-mode .instructions-box-main li::before {
    background: linear-gradient(135deg, #81c784 0%, #4db8a8 100%);
}
.instructions-box-main li:last-child {
    margin-bottom: 0;
}
.instructions-box-main strong:not(.text-blue):not(.text-black) {
    color: var(--primary-color);
    font-weight: 700;
    background: linear-gradient(135deg, #2E7D32 0%, #00897b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.dark-mode .instructions-box-main strong:not(.text-blue):not(.text-black) {
    background: linear-gradient(135deg, #81c784 0%, #4db8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.instructions-box-main strong.text-blue {
    color: #0052A3 !important;
    font-weight: 700;
    background: none;
    -webkit-text-fill-color: #0052A3;
}
body.dark-mode .instructions-box-main strong.text-blue {
    color: #5BA3FF !important;
    -webkit-text-fill-color: #5BA3FF;
}

.instructions-box-main strong.text-black {
    color: #000000 !important;
    font-weight: 700;
    background: none;
    -webkit-text-fill-color: #000000;
}
body.dark-mode .instructions-box-main strong.text-black {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

/* --- Separator --- */
.section-separator {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 2.5rem auto;
}

/* --- Content Panels --- */
.content-panel {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.content-panel h1 { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.75rem; 
    font-size: 1.5rem; 
    margin: 0 0 1rem 0; 
    color: var(--primary-color); 
}
body.dark-mode .content-panel h1 { 
    color: #66bb6a; 
}
.content-panel h1 svg { 
    width: 28px; 
    height: 28px; 
    flex-shrink: 0; 
}
.content-panel h4 { 
    display: flex; 
    align-items: center; 
    font-size: 1.1rem; 
    font-weight: 600; 
    margin: 0 0 1rem 0; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 0.75rem; 
}
.content-panel h4 svg { 
    width: 20px; 
    height: 20px; 
    margin-right: 0.75rem; 
    fill: currentColor; 
}

/* --- Notification Panel Specific Styles --- */
.content-panel.updates-panel {
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.08) 0%, rgba(255, 152, 0, 0.05) 100%);
    border: 2px solid rgba(255, 152, 0, 0.2);
    box-shadow: 0 8px 24px rgba(255, 152, 0, 0.1);
}
body.dark-mode .content-panel.updates-panel {
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.12) 0%, rgba(255, 152, 0, 0.08) 100%);
    border: 2px solid rgba(255, 183, 77, 0.3);
}
.updates-panel h4 {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.2rem;
}
body.dark-mode .updates-panel h4 {
    background: linear-gradient(135deg, #ffb74d 0%, #ffa726 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.updates-panel ul { 
    list-style-type: none; 
    padding: 0; 
    margin: 0; 
    overflow-y: auto; 
    max-height: 350px; 
}
.updates-panel li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.8rem 0;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
    color: var(--text-muted);
    gap: 0.5rem;
    transition: all 0.3s ease;
}
.updates-panel li:hover {
    transform: translateX(4px);
}
.updates-panel li:last-child {
    margin-bottom: 0;
}

/* Ensure the bullet point aligns at the start */
.updates-panel li::before {
    content: '';
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
}
body.dark-mode .updates-panel li::before {
    background: linear-gradient(135deg, #ffb74d 0%, #ffa726 100%);
}


/* New general styling for the individual date/time "badges" */
.notification-date-badge,
.notification-time-badge {
    display: inline-flex; /* Use inline-flex for proper padding and alignment */
    align-items: center;
    padding: 4px 8px; /* Padding for badge appearance */
    border-radius: 6px; /* Slightly rounded corners */
    font-size: 0.75rem; /* Smaller text size for badges */
    font-weight: 600; /* Bold text */
    color: white; /* White text on badges */
    margin-left: 0.6rem; /* Space between the text and badges, and between badges */
    flex-shrink: 0; /* Prevent them from shrinking */
    line-height: 1; /* Tighter line height for the text inside badge */
}

/* Specific color for the date badge (BLUE) */
.notification-date-badge {
    background-color: #2e7d32; /* Green */
}
body.dark-mode .notification-date-badge {
    background-color: #4caf50; /* Lighter green in dark mode */
}

/* Specific color for the time badge (GREEN) */
.notification-time-badge {
    background-color: #2ecc71; /* Green */
}
body.dark-mode .notification-time-badge {
    background-color: #58d68d; /* Lighter green in dark mode */
}

/* Style for the notification text to take up remaining space and allow flex layout */
.notification-text {
    flex-grow: 1; /* Allows text to take up available space before badges */
}

/* Ensure new badge positioning for consistency with time/date badges */
.new-badge { 
    background-color: var(--danger-color); 
    color: white; 
    font-size: 0.65rem; 
    font-weight: bold; 
    padding: 3px 8px; 
    border-radius: 4px; 
    margin-left: 0.6rem; /* Keep spacing consistent */
    vertical-align: middle; 
    flex-shrink: 0; /* Prevent it from shrinking */
}


.updates-panel li:last-child {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

/* --- Support Box Style --- */
.support-box {
    padding: 2rem;
    margin: 1.5rem 0;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.08) 0%, rgba(229, 57, 53, 0.05) 100%);
    border: 2px solid rgba(244, 67, 54, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(244, 67, 54, 0.1);
    position: relative;
    overflow: visible;
}
body.dark-mode .support-box {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.12) 0%, rgba(229, 57, 53, 0.08) 100%);
    border: 2px solid rgba(244, 67, 54, 0.3);
}

/* Hide support box when preview is active */
.main-content-wrapper.layout-preview-active .support-box {
    display: none;
}

.support-box h4 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: #f44336;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}
body.dark-mode .support-box h4 {
    color: #ef5350;
}

.support-box h4 svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: #f44336;
    filter: none;
}
body.dark-mode .support-box h4 svg {
    stroke: #ef5350;
}

.support-box p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.92rem;
    position: relative;
    z-index: 1;
    text-align: justify;
}

.text-blue {
    color: #0052A3;
    font-weight: 700;
}
.text-black {
    color: #000000;
    font-weight: 700;
}
body.dark-mode .text-black {
    color: #ffffff;
    font-weight: 700;
}
body.dark-mode .text-blue {
    color: #5BA3FF;
    font-weight: 700;
}
.text-red {
    color: #f44336;
    font-weight: 700;
}
body.dark-mode .text-red {
    color: #ef5350;
    font-weight: 700;
}
.text-red-light {
    color: #ef5350;
    font-weight: 700;
}
body.dark-mode .text-red-light {
    color: #f48482;
    font-weight: 700;
}
/* --- Form & Buttons --- */
.step-description { 
    text-align: center; 
    color: var(--text-muted); 
    margin-bottom: 1.5rem; 
    font-size: 1.1rem; /* Slightly larger for emphasis */
}
.form-group { 
    margin-bottom: 1.5rem; /* Increased spacing */
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}
input, select {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    line-height: 1.2; /* A specific line-height can help vertical centering of content */
}

/* New/Modified styles specifically for select elements to fix arrow position */
select {
    -webkit-appearance: none; /* Remove default arrow for Chrome/Safari */
    -moz-appearance: none;    /* Remove default arrow for Firefox */
    appearance: none;         /* Remove default arrow for other browsers */

    /* Add a custom SVG arrow as background-image */
    /* The SVG is a simple caret icon: fill='currentColor' will inherit the text color */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center; /* Position the arrow 15px from the right, vertically centered */
    background-size: 18px 18px; /* Size of the arrow icon */
    padding-right: 40px; /* Add more padding on the right to make space for the custom arrow */
}


input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 82, 163, 0.1);
}
body.dark-mode input:focus, body.dark-mode select:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(93, 173, 226, 0.15);
}

button {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
button:hover {
    background-color: #1b5e20;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
body.dark-mode button {
    background-color: #4caf50;
    color: #121212;
}
body.dark-mode button:hover {
    background-color: #66bb6a;
    color: #121212;
}
.secondary-button {
    background-color: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}
.secondary-button:hover {
    background-color: rgba(0, 82, 163, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
body.dark-mode .secondary-button { 
    border-color: #4caf50; 
    color: #4caf50; 
}
body.dark-mode .secondary-button:hover { 
    background-color: rgba(93, 173, 226, 0.1); 
}
.red-button { 
    background-color: var(--danger-color); 
    border-color: var(--danger-color); 
    color: white; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}
.red-button:hover { 
    background-color: #a52a2a; 
    border-color: #a52a2a; 
    color: white; 
}
.confirmation-question { 
    text-align: center; 
    font-weight: 600; 
    margin-top: 1.5rem; 
    margin-bottom: 1rem; 
    color: var(--primary-color); 
    font-size: 1.1rem; /* Slightly larger for emphasis */
    padding: 0.5rem 0; /* Added padding for prominence */
}
body.dark-mode .confirmation-question { 
    color: #66bb6a; 
}

.confirmation-buttons { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1rem; 
    margin-top: 1.5rem; /* Added margin-top for separation */
    margin-bottom: 1rem; 
}
.form-section { 
    max-height: 0; 
    opacity: 0; 
    overflow: hidden; 
    transition: all 0.6s ease-in-out; 
}
#secondary-criteria.visible { 
    max-height: 1000px; 
    opacity: 1; 
    margin-top: 2rem; 
    padding-top: 2rem; 
    border-top: 2px dashed var(--border-color); 
}
.autocomplete { 
    position: relative; 
}
#name-suggestions { 
    position: absolute; 
    border: 1px solid var(--border-color); 
    max-height: 150px; 
    overflow-y: auto; 
    width: 100%; 
    background-color: var(--card-bg); 
    z-index: 1000; 
    border-radius: 0 0 8px 8px; /* Match new border-radius for input */
    box-shadow: var(--shadow); 
}
.suggestion-item { 
    padding: 10px 15px; 
    cursor: pointer; 
    transition: background-color 0.2s ease;
}
.suggestion-item:hover { 
    background-color: var(--bg-color); 
}
#search-result { 
    text-align: center; 
    margin-top: 1.5rem; 
    font-weight: 600; 
    color: #e74c3c; 
}
#not-found-container { 
    display: none; 
    text-align: center; 
    margin-top: 1.5rem; 
}
#not-found-container p { 
    margin-bottom: 1rem; 
    color: var(--text-muted); /* Ensure color consistency */
}

/* --- ADMIT CARD PREVIEW --- */
.preview-view-wrapper .actions-panel button { 
    margin-bottom: 1rem; 
}
.preview-view-wrapper .actions-panel button svg { 
    width: 18px; 
    height: 18px; 
}
.preview-admit-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* --- ADMIT CARD STYLES --- */
.admit-card-a4 { 
    background: white; 
    width: 100%; 
    padding: 15mm; 
    color: black; 
    font-family: 'Poppins', sans-serif; 
    font-size: 9pt; 
    line-height: 1.5; 
    position: relative; 
    overflow: hidden; 
}
.admit-card-separator {
    border: none;
    height: 1px; 
    background-color: #dee2e6; 
    margin: 1.5rem 0; 
    width: 100%; 
}
body.dark-mode .admit-card-a4 .admit-card-separator {
    background-color: black;
}
.ac-watermark { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    z-index: 1; 
    opacity: 0.08; 
    pointer-events: none; 
}
.ac-watermark img { 
    width: 300px; 
    height: auto; 
}
.ac-content { 
    position: relative; 
    z-index: 2; 
    background-color: transparent; 
}
.ac-header { 
    display: flex; 
    align-items: center; 
    padding-bottom: 0.75rem; 
    margin-bottom: 1rem; 
    border-bottom: 2px solid var(--primary-color); 
}
.ac-logo { 
    height: 70px; 
    margin-right: 1rem; 
}
.ac-title-area h1 { 
    font-size: 18pt; 
    line-height: 1.1; 
    color: var(--primary-color); 
}
.ac-title-area h3 {
    color: var(--secondary-color);
}
.ac-general-instructions-box { 
    padding: 0; 
    margin-bottom: 1rem; 
}
.ac-general-instructions-box h4 { 
    font-size: 10pt; 
    font-weight: 600; 
    margin: 0; 
    margin-bottom: 0.5rem; 
    color: var(--primary-color); 
    display: inline-block; 
    border-bottom: 1px solid currentColor; 
    padding-bottom: 2px; 
}
.ac-general-instructions-box h4 u {
    text-decoration: none; 
}
.ac-general-instructions-box ol { 
    padding-left: 20px; 
    margin: 0; 
    list-style-position: outside; 
    color: black !important; 
}
.ac-general-instructions-box li {
    margin-bottom: 0.75rem;
    color: black !important; /* Ensure text is black for print */
    line-height: 1.5;
    text-align: justify;
}
.ac-general-instructions-box li:last-child { 
    margin-bottom: 0; 
}
.ac-general-instructions-box strong {
    color: black !important;
}

.ac-general-instructions-box strong.text-blue {
    color: #0052A3 !important;
}

.ac-general-instructions-box strong.text-black {
    color: #000000 !important;
}
.ac-candidate-details { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 1rem; 
    gap: 2rem; 
    border-bottom: 1px solid #dee2e6; 
    padding-bottom: 1rem; 
}
.ac-details-grid { 
    flex-grow: 1; 
    display: grid; 
    grid-template-columns: auto 1fr; 
    gap: 0.5rem 1rem; 
    align-items: flex-start; 
}
.ac-detail-label, .ac-sign-box p, .ac-photo-box { 
    color: var(--text-muted-light); 
}
.ac-detail-value { 
    word-break: break-word; 
    font-weight: 600; 
    text-transform: uppercase;
    color: black !important; 
}
.ac-photo-box { 
    border: 2px dashed #dee2e6; 
    width: 120px; 
    height: 150px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 8px; 
    border-radius: 4px; 
}
.ac-data-table { 
    margin-bottom: 1.5rem; 
}
.ac-data-table table { 
    width: 100%; 
    border-collapse: collapse; 
}
.ac-data-table th, .ac-data-table td { 
    border: 1px solid #dee2e6; 
    padding: 10px; 
    text-align: left; 
}
.ac-data-table th { 
    background-color: var(--background-light); 
    color: var(--primary-color); 
}
.ac-signatures { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-top: 1rem; 
}
.ac-sign-box { 
    width: 30%; 
    text-align: center; 
}
.ac-sign-placeholder { 
    height: 40px; 
    border-bottom: 1px solid black; 
    margin-bottom: 5px; 
}
.controller-sign { 
    position: relative; 
}
.controller-sign-img { 
    height: 40px; 
    position: absolute; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
}
.ac-final-instructions { 
    margin-top: 1.5rem; 
}
.ac-final-instructions .instruction-heading { 
    text-align: center; 
    font-size: 11pt; 
    font-weight: bold; 
    margin-bottom: 0.75rem; 
}
.ac-final-instructions ol { 
    padding-left: 20px; 
    margin: 0; 
    font-size: 8.5pt; 
    list-style-position: outside; 
    color: black !important; /* Ensure list text is explicitly black */
}
.ac-final-instructions li { 
    margin-bottom: 0.4rem; 
    color: black !important; /* Ensure text is black for print */
}
.ac-final-instructions .highlight-red { 
    color: var(--danger-color) !important; /* Keep red color */
    font-weight: 600; 
}

/* ADMIT CARD DARK MODE OVERRIDE (FORCES LIGHT THEME) */
body.dark-mode .admit-card-a4 { 
    background-color: white; 
    color: black; 
}
body.dark-mode .admit-card-a4 .ac-title-area p,
body.dark-mode .admit-card-a4 .ac-detail-label, 
body.dark-mode .admit-card-a4 .ac-sign-box p, 
body.dark-mode .admit-card-a4 .ac-photo-box { 
    color: var(--text-muted-light); 
}
body.dark-mode .admit-card-a4 .ac-title-area h2,
body.dark-mode .admit-card-a4 .instruction-heading,
body.dark-mode .admit-card-a4 .text-black,
body.dark-mode .admit-card-a4 .ac-detail-value,
body.dark-mode .admit-card-a4 .ac-general-instructions-box ol,
body.dark-mode .admit-card-a4 .ac-general-instructions-box li,
body.dark-mode .admit-card-a4 .ac-general-instructions-box strong,
body.dark-mode .admit-card-a4 .ac-final-instructions ol,
body.dark-mode .admit-card-a4 .ac-final-instructions li,
body.dark-mode .admit-card-a4 .ac-final-instructions strong { 
    color: black !important; 
}
body.dark-mode .ac-general-instructions-box h4 {
    color: var(--primary-color) !important; 
}
body.dark-mode .admit-card-a4 .ac-candidate-details { 
    border-color: var(--border-color-light); 
}
body.dark-mode .admit-card-a4 .ac-photo-box { 
    border-color: var(--border-color-light); 
}
body.dark-mode .admit-card-a4 .ac-data-table th, 
body.dark-mode .admit-card-a4 .ac-data-table td { 
    border-color: var(--border-color-light); 
}
body.dark-mode .admit-card-a4 .ac-data-table th { 
    background-color: var(--background-light); 
}
body.dark-mode .admit-card-a4 .ac-sign-placeholder { 
    border-color: black; 
}
body.dark-mode .ac-watermark,
body.dark-mode .controller-sign-img { 
    filter: none; 
}
body.dark-mode .ac-watermark { 
    opacity: 0.08; 
}


/* --- MODAL STYLES --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;

    /* Initial state for transition */
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal-overlay.modal-active {
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);

    /* Initial state for transition */
    transform: translateY(-10px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
.modal-overlay.modal-active .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    font-size: 2.5rem; /* Larger close button */
    font-weight: bold; 
    color: var(--text-muted); 
    cursor: pointer; 
    line-height: 1; 
    transition: color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { 
    color: var(--text-color); 
    transform: rotate(90deg);
}
.modal-content h2 { 
    margin-top: 0; 
    color: var(--primary-color); 
    text-align: center; 
    margin-bottom: 1.5rem; 
    font-size: 1.8rem; /* Larger modal title */
}
.modal-content p { 
    color: var(--text-muted); 
    margin-bottom: 1rem; 
    font-size: 1rem; /* Slightly larger text */
}
.modal-results-container { 
    margin-top: 1.5rem; 
    border-top: 1px solid var(--border-color); 
    padding-top: 1.5rem; 
    max-height: 250px; 
    overflow-y: auto; 
}
.modal-result-item { 
    padding: 12px 15px; 
    border: 1px solid var(--border-color); 
    /* Increased border-radius */
    border-radius: 12px; 
    margin-bottom: 10px; 
    cursor: pointer; 
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease; 
}
.modal-result-item:hover { 
    background-color: var(--bg-color); 
    border-color: var(--primary-color); 
    transform: translateY(-2px); /* Subtle lift */
}
.modal-result-item strong { 
    color: var(--primary-color); 
    display: block; 
    font-size: 1.1em; 
}
.modal-result-item span { 
    font-size: 0.9em; 
    color: var(--text-muted); 
}
.instruction-text { 
    text-align: center; 
    line-height: 1.6; 
}
.instruction-text .email-address { 
    font-weight: bold; 
    font-size: 1.1rem; 
    background-color: var(--bg-color); 
    padding: 12px; 
    border-radius: 12px; /* Consistent rounded corners */
    margin: 1rem 0; 
}
.instruction-text .email-address a { 
    color: var(--primary-color); 
    text-decoration: none; 
}
body.dark-mode .instruction-text .email-address a { 
    color: #66bb6a; 
}

/* NEW: Form link button styling - consistency with primary buttons */
.form-link-button {
    display: inline-flex; /* Use flex for icon/text alignment if ever needed */
    background-color: rgb(211, 233, 248);;
    color: white;
    padding: 12px 25px; /* More generous padding */
    border-radius: 25px; /* Consistent rounded corners */
    text-decoration: none;
    margin-top: 0px; /* More spacing */
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.form-link-button:hover {
    background-color:rgb(165, 214, 167); /* Darker shade on hover */
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
body.dark-mode .form-link-button {
    background-color: #4caf50;
    color: #121212;
}
body.dark-mode .form-link-button:hover {
    background-color: #66bb6a;
    color: #121212;
}


.modal-list-header {
    text-align: center;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.details-to-include-box {
    background-color: rgba(220, 53, 69, 0.05);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
}
body.dark-mode .details-to-include-box {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
}
.details-to-include-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.details-to-include-box ul li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}
.details-to-include-box ul li:last-child {
    margin-bottom: 0;
}
.details-to-include-box ul li::before {
    content: '•';
    color: var(--danger-color);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.2rem;
    line-height: 1.6;
}
.details-to-include-box strong {
    color: var(--danger-color);
}
.final-reminder {
    font-weight: 600;
    color: var(--danger-color);
    margin-top: 1.5rem !important;
}

/* --- PRINT STYLES --- */
@media print {
    body { 
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        background: white !important; 
        font-size: 100% !important; /* Ensure default font size for printing calculation */
    }
    @page { 
        size: A4; 
        margin: 0; 
    }
    html, body.dark-mode, body { 
        background: white !important;
    }
    .page-header, .initial-view-wrapper, .actions-panel, .page-footer, .modal-overlay, .main-content-wrapper > .page-title, .instructions-box-main, .section-separator {
        display: none !important;
    }
    /* Added to prevent content break on subsequent pages if content is very long */
    .admit-card-a4 {
        break-after: always;
        orphans: 3;
        widows: 3;
    }
    
    .main-content-wrapper { 
        padding: 0 !important; 
        margin-top: 0 !important; 
        min-height: 100vh; 
        display: flex;
        justify-content: center;
        align-items: flex-start; 
    }
    .preview-view-wrapper, .preview-admit-card {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important; 
        flex: 1; 
    }

    .admit-card-a4 {
        width: 210mm !important;
        height: 297mm !important; 
        padding: 20mm 15mm !important; 
        font-size: 8.5pt !important;
        color: black !important;
        display: block !important;
        margin: 0 auto !important; 
    }
    .admit-card-a4 * {
        color: black !important;
        background-color: transparent !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .ac-watermark { 
        opacity: 0.1 !important; 
        filter: none !important; 
    }
    .controller-sign-img { 
        filter: none !important; 
    }
    .ac-candidate-details,
    .ac-data-table {
        margin-bottom: 0.75rem !important; 
    }
    .ac-general-instructions-box ol,
    .ac-final-instructions ol {
        list-style-position: outside !important; 
        margin-left: 0.5cm !important; 
    }
    .ac-final-instructions ol {
        page-break-inside: avoid;
    }
}
