/* Modern CSS for StudentWeb - Bootstrap 5 Compatible */
/* Clean, Professional Theme */

:root {
    /* ========================================
       BASE THEME COLOR - Change this to update entire theme
       ======================================== */
    --primary: #4A77D4;
    --primary-dark: #3A5BA8;
    --primary-light: #6B93E0;

    /* Secondary Colors */
    --secondary: #5a6c7d;
    --secondary-dark: #4a5a69;

    /* Accent Colors */
    --accent: #e8913a;
    --accent-dark: #d17f2e;

    /* Neutral Colors */
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --text-light: #95a5a6;

    /* Background Colors */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #e9ecef;

    /* Border & Shadow */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);

    /* Spacing & Radius */
    --radius: 6px;
    --radius-lg: 10px;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #fff !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-dark) !important;
    border-color: var(--secondary-dark) !important;
}

/* Disabled buttons - muted gray, not bright */
.btn:disabled,
.btn.disabled,
.btn[disabled],
input[type="submit"]:disabled,
input[type="button"]:disabled {
    background-color: #b0b8c1 !important;
    border-color: #b0b8c1 !important;
    color: #fff !important;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Login button specific fix */
.btn-login {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    width: 100%;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
}

.btn-login:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

/* Small buttons */
.btn-sm, .btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Medium buttons */
.btn-md {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* ===== PAGE LAYOUT ===== */
#pageHeader {
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

#bar {
    margin: 0;
    padding: 0;
    text-align: center;
}

#colContainer {
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

#colContainer > div {
    margin: 0;
    padding: 0;
}

#pageContent {
    margin: 0 auto;
    text-align: left;
    padding: 0;
}

#pageFooter {
    margin: 1rem auto 0;
    text-align: center;
    padding: 1.25rem 0;
    color: #666;
    font-size: 0.85rem;
    background-color: #e9ecef;
    border-top: 1px solid var(--border-color);
}

#pageFooter a {
    color: #8b0000;
    text-decoration: none;
}

#title {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== LOGIN CARD ===== */
.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    border: 1px solid var(--border-light);
}

.login-header {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.login-header h5 {
    color: var(--primary);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.login-instructions {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== FORMS ===== */
.form-control {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 119, 212, 0.15);
}

.form-select {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 119, 212, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== GRIDVIEW / TABLES ===== */
.GridViewStyle {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 450;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
}

.GridViewStyle td,
.GridViewStyle th {
    font-weight: 450;
    font-size: 0.95rem;
    color: #333;
    border: 1px solid var(--border-color);
}

/* GridView Header - multiple selectors for maximum specificity */
.GridViewStyle > tbody > tr:first-child,
.GridViewStyle > tbody > tr:first-child > th,
.GridViewStyle > tbody > tr:first-child > td,
.GridViewStyle > tr:first-child,
.GridViewStyle > tr:first-child > th,
.GridViewStyle > tr:first-child > td,
.GridViewStyle tr:first-child,
.GridViewStyle tr:first-child th,
.GridViewStyle tr:first-child td,
.GridViewStyle tr.HeaderStyle,
.GridViewStyle tr.HeaderStyle th,
.GridViewStyle tr.HeaderStyle td,
.GridViewStyle thead tr,
.GridViewStyle thead th,
.GridViewStyle thead td,
table.GridViewStyle > tbody > tr:first-child,
table.GridViewStyle > tbody > tr:first-child > th,
table.GridViewStyle > tbody > tr:first-child > td,
table.GridViewStyle tr:first-child,
table.GridViewStyle tr:first-child th,
table.GridViewStyle tr:first-child td,
.HeaderStyle,
.HeaderStyle th,
.HeaderStyle td,
tr.HeaderStyle,
tr.HeaderStyle th,
tr.HeaderStyle td {
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 0.5rem !important;
    border: none !important;
}

/* Override Bootstrap table styles */
.table > :not(caption) > * > *,
table.GridViewStyle > :not(caption) > * > * {
    background-color: inherit;
}

/* Reset Bootstrap table variables and force header colors */
.GridViewStyle,
.GridViewStyle tr,
.GridViewStyle th,
.GridViewStyle td {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: transparent;
}

.GridViewStyle tr:first-child,
.GridViewStyle tr:first-child th,
.GridViewStyle tr:first-child td,
.GridViewStyle tr:first-child th *,
.GridViewStyle tr:first-child td *,
.HeaderStyle,
.HeaderStyle th,
.HeaderStyle td,
.HeaderStyle th *,
.HeaderStyle td *,
tr.HeaderStyle,
tr.HeaderStyle th,
tr.HeaderStyle td,
tr.HeaderStyle th *,
tr.HeaderStyle td * {
    --bs-table-bg: var(--primary) !important;
    --bs-table-color: #fff !important;
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

/* Extra specificity for header text */
table.GridViewStyle > tbody > tr:first-child > th,
table.GridViewStyle > tbody > tr:first-child > td,
table.GridViewStyle > tbody > tr:first-child > th *,
table.GridViewStyle > tbody > tr:first-child > td * {
    color: #fff !important;
}

.PagerStyle {
    background-color: var(--primary);
    padding: 0.5rem;
}

.PagerStyle a,
.PagerStyle span {
    color: #fff;
    padding: 0.25rem 0.5rem;
    margin: 0 2px;
    border-radius: 4px;
    text-decoration: none;
}

.PagerStyle a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.AlternateRowStyle {
    background-color: #f8fafb;
}

.AlternateRowStyle td {
    font-weight: 450;
    font-size: 0.95rem;
    color: #333;
}

.selectedRowStyle {
    background-color: #e3ecf9;
}

.table > thead {
    background-color: var(--primary);
    color: #fff;
}

.table > thead th {
    font-weight: 600;
    border: none;
    background-color: var(--primary);
    color: #fff;
}

/* ===== LABELS ===== */
.LabelTitle {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
}

.LabelStyle {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.ErrorLabelStyle {
    color: #dc3545;
    font-weight: 500;
}

/* ===== MODAL & POPUP ===== */
.CenterPosition {
    display: block;
    border: 1px solid var(--border-color);
    position: fixed;
    width: 280px;
    background-color: var(--bg-card);
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    z-index: 10000;
}

.modalBackground {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }

.card {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.card-header {
    background-color: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* Info box for instructions */
.info-box {
    background-color: #e8f0fa;
    border: 1px solid #c3d6e8;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.info-box-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* ===== MENU STYLES ===== */
.StaticMenuStyle { background-color: var(--bg-light); }
.StaticMenuItemStyle { color: var(--text-dark); padding: 0.5rem 0; }
.StaticHoverStyle { background-color: var(--bg-dark); }
.DynamicMenuStyle { background-color: var(--bg-dark); }
.DynamicMenuItemStyle { color: var(--text-dark); padding: 0.25rem 0.75rem; }
.DynamicHoverStyle { background-color: var(--bg-light); }

/* ===== OLD CUSTOM STYLES (Compatibility) ===== */
.ButtonStyle {
    color: var(--primary);
    background-color: var(--bg-light);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.TextboxStyle {
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
}

.LoginStyle {
    border: 1px solid var(--primary);
    background-color: var(--bg-light);
    border-radius: var(--radius);
    padding: 1rem;
}

.HideStyle { visibility: hidden; }
.hiddencol { display: none; }
.invisible { position: absolute; left: -9999px; }

.timer {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius);
    color: #856404;
}

.promptclass {
    color: #fff;
    font-weight: 600;
    background-color: var(--primary);
    text-align: center;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
}

.borderonly {
    border: 1px solid var(--primary);
    border-radius: var(--radius);
}

/* Panel styles */
.panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.panel-heading {
    background-color: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 600;
}

.panel-body {
    padding: 1rem;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* No underline for links inside buttons */
.btn:hover,
.btn a:hover,
a.btn:hover {
    text-decoration: none;
}

.btn a {
    color: inherit;
    text-decoration: none;
}

.btn a:hover {
    color: inherit;
    text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .CenterPosition {
        width: 90%;
        max-width: 300px;
    }

    #pageFooter {
        font-size: 0.75rem;
        padding: 1rem 0;
    }
}

/* ===== PAGE TITLE ===== */
.page-title {
    background-color: #e9ecef;
    padding: 1rem 1.5rem;
    margin: 0.75rem 0 1rem 0;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid #dee2e6;
}

.page-title h1 {
    font-family: Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    font-style: italic;
    color: #000080;
    margin: 0;
}

/* ===== PRINT ===== */
@media print {
    #pageHeader, #pageFooter, #pageMenu, .my-navbar { display: none; }
    #pageContent { margin: 0; padding: 0; }
}
