@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');

:root {
    /* Light Mode Palette (Custom Blue Scheme) */
    --bg-color: #e3faff;
    --surface-color: #f0fbff;
    --text-color: #004b62;
    --text-secondary: #0081a7;
    --primary-color: #0081a7;
    --primary-hover: #006a8a;
    --border-color: #004b62;
    --border-light: rgba(0, 129, 167, 0.15);
    --accent-color: #93dbff;
    --danger-color: #ff5959;
    --warning-color: #ff5959;
    /* Using danger color for warnings */
    --success-color: #61dc9b;
    --sidebar-bg: #004b62;
    --sidebar-text: #f0fbff;
    --sidebar-hover: #0081a7;
    --shadow: 0 4px 6px rgba(0, 75, 98, 0.15);

    /* Chart Colors */
    --chart-strong: #61dc9b;
    --chart-needs-work: #ff5959;
    --chart-other: #93dbff;
    --chart-border: #555555;
}

body.dark-mode {
    /* Dark Mode Palette (Custom Blue Scheme) */
    --bg-color: #001f2b;
    --surface-color: #003547;
    --text-color: #d6f8ff;
    --text-secondary: #93dbff;
    --primary-color: #0081a7;
    --primary-hover: #006a8a;
    --border-color: #0081a7;
    --border-light: rgba(147, 219, 255, 0.15);
    --accent-color: #93dbff;
    --danger-color: #CC0000;
    --warning-color: #CC0000;
    /* Using danger color for warnings */
    --success-color: #25A762;
    --sidebar-bg: #004b62;
    --sidebar-text: #f0fbff;
    --sidebar-hover: #0081a7;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);

    /* Chart Colors - Dark Mode */
    --chart-strong: #25A762;
    --chart-needs-work: #CC0000;
    --chart-other: #0081a7;
    --chart-border: #d6f8ff;
}

/* Toasty Light Mode */
body.toasty-mode {
    /* Toasty Light Palette (Warm Earth Tones) */
    --bg-color: #fdeae7;
    --surface-color: #f7d0bd;
    --text-color: #611700;
    --text-secondary: #8b2000;
    --primary-color: #bd0600;
    --primary-hover: #8b0400;
    --border-color: #d2691e;
    --border-light: rgba(189, 6, 0, 0.15);
    --accent-color: #FFFA75;
    --danger-color: #bd0600;
    --warning-color: #d2691e;
    --success-color: #FFFA75;
    --sidebar-bg: #8b2000;
    --sidebar-text: #fdeae7;
    --sidebar-hover: #bd0600;
    --shadow: 0 4px 6px rgba(97, 23, 0, 0.15);

    /* Chart Colors - Toasty Light */
    --chart-strong: #FFFA75;
    --chart-needs-work: #bd0600;
    --chart-other: #f7a08e;
    --chart-border: #555555;
}

/* Toasty Dark Mode */
body.toasty-mode.dark-mode {
    /* Toasty Dark Palette */
    --bg-color: #611700;
    --surface-color: #8b2000;
    --text-color: #fdeae7;
    --text-secondary: #f7d0bd;
    --primary-color: #f7a08e;
    --primary-hover: #e9783f;
    --border-color: #d2691e;
    --border-light: rgba(247, 160, 142, 0.15);
    --accent-color: #FFFA75;
    --danger-color: #ff6b6b;
    --warning-color: #d2691e;
    --success-color: #FFFA75;
    --sidebar-bg: #3d0d00;
    --sidebar-text: #fdeae7;
    --sidebar-hover: #bd0600;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);

    /* Chart Colors - Toasty Dark */
    --chart-strong: #FFFA75;
    --chart-needs-work: #ff6b6b;
    --chart-other: #f7a08e;
    --chart-border: #fdeae7;
}

/* Toasty Theme Component Overrides */
body.toasty-mode .secondary-nav {
    background-color: var(--primary-color);
}

body.toasty-mode.dark-mode .secondary-nav {
    background-color: var(--sidebar-bg);
}

/* Fix yellow button text to be black for readability */
body.toasty-mode .grade-lock-btn.lock-on,
body.toasty-mode button[style*="background-color: var(--accent-color)"],
body.toasty-mode .pill-btn {
    color: #000 !important;
}

/* Show Predictions button - OFF state should be brown */
body.toasty-mode .grade-lock-btn.lock-off {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* Total weight indicator - use red/brown theme */
body.toasty-mode #total-weight-indicator {
    background-color: #f7d0bd !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--border-color) !important;
}

body.toasty-mode.dark-mode #total-weight-indicator {
    background-color: var(--surface-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}

/* Stats bars - use pale red/orange */
body.toasty-mode .stats-tag,
body.toasty-mode .toggle-btn.active,
body.toasty-mode .pill-btn {
    background: var(--primary-color);
}

body.toasty-mode.dark-mode .stats-tag,
body.toasty-mode.dark-mode .toggle-btn.active {
    background: var(--primary-color);
}

/* Toast messages - dark text on yellow background */
body.toasty-mode .toast.success {
    color: #000;
}

/* Table headers - use brown instead of blue */
body.toasty-mode th,
body.toasty-mode .table-wrapper thead,
body.toasty-mode .table-wrapper thead th,
body.toasty-mode .table-wrapper thead .summary-row td {
    background-color: #f7d0bd !important;
    color: var(--text-color) !important;
}

body.toasty-mode.dark-mode th,
body.toasty-mode.dark-mode .table-wrapper thead,
body.toasty-mode.dark-mode .table-wrapper thead th,
body.toasty-mode.dark-mode .table-wrapper thead .summary-row td {
    background-color: var(--surface-color) !important;
    color: var(--text-color) !important;
}

/* Edit button in dark mode - fix blue */
body.toasty-mode.dark-mode .edit-btn {
    background-color: var(--primary-color) !important;
    color: #000 !important;
    /* Better contrast on salmon */
}

body.toasty-mode.dark-mode .edit-btn:hover {
    background-color: var(--primary-hover) !important;
}

/* Edit button in toasty light mode - black text */
body.toasty-mode .edit-btn {
    color: #000 !important;
}

/* Predict button in toasty light mode - black text */
body.toasty-mode .predict-btn,
body.toasty-mode #predict-btn,
body.toasty-mode #show-predictions-btn {
    color: #000 !important;
}

/* Predict button in toasty dark mode - black text */
body.toasty-mode.dark-mode .predict-btn,
body.toasty-mode.dark-mode #predict-btn,
body.toasty-mode.dark-mode #show-predictions-btn {
    color: #000 !important;
}

/* Darker yellow/gold for grade lock on in Toasty Dark Mode */
body.toasty-mode.dark-mode .grade-lock-btn.lock-on,
body.toasty-mode.dark-mode #grade-lock-btn.lock-on,
body.toasty-mode.dark-mode #show-predictions-btn.lock-on,
body.toasty-mode.dark-mode #addPredictionBtn {
    background-color: #c9c540 !important;
    color: #000 !important;
    border: 1px solid #b0ac30 !important;
    /* Adding border to ensure visibility */
}

body {
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

input,
button,
select,
textarea {
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
}

/* --- Sidebar Styles (Hidden - using top nav instead) --- */
.sidebar {
    display: none;
}

.overlay {
    display: none !important;
}

/* Legacy sidebar styles kept for reference
.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: -250px;
    background-color: var(--sidebar-bg);
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}
*/

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: var(--sidebar-text);
    border-bottom: 1px solid var(--sidebar-hover);
    margin-bottom: 10px;
}

.sidebar-header h3 {
    margin: 0;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 30px;
    cursor: pointer;
}

.sidebar-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 16px;
    color: var(--sidebar-text);
    display: block;
    transition: 0.2s;
}

.sidebar-menu li a:hover {
    background-color: var(--sidebar-hover);
}

/* Dark Mode Toggle in Sidebar */
.theme-toggle-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--sidebar-text);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Icon switches - larger size with emoji icons */
.switch.icon-switch {
    width: 56px;
    height: 28px;
}

.switch.icon-switch .slider {
    border-radius: 28px;
}

.switch.icon-switch .slider:before {
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.switch.icon-switch input:checked+.slider:before {
    transform: translateX(28px);
}

/* Theme toggle (sun/moon) */
.switch.theme-switch .slider {
    background-color: #87CEEB;
}

.switch.theme-switch .slider:before {
    content: "☀️";
    background-color: white;
}

.switch.theme-switch input:checked+.slider {
    background-color: #2c3e50;
}

.switch.theme-switch input:checked+.slider:before {
    content: "🌙";
    background-color: #1a1a2e;
}

/* Scheme toggle (frosty/toasty) */
.switch.scheme-switch .slider {
    background-color: #87CEEB;
}

.switch.scheme-switch .slider:before {
    content: "❄️";
    background-color: white;
}

.switch.scheme-switch input:checked+.slider {
    background-color: #e07b39;
}

.switch.scheme-switch input:checked+.slider:before {
    content: "🔥";
    background-color: #5c4033;
}

/* Dark mode adjustments for switch circles */
body.dark-mode .switch.scheme-switch .slider:before {
    background-color: #1a1a2e;
}

body.dark-mode .switch.scheme-switch input:checked+.slider:before {
    background-color: #3d2817;
}

/* Submenu */
.has-submenu .submenu {
    display: none;
    list-style-type: none;
    padding-left: 0;
    background-color: rgba(0, 0, 0, 0.2);
}

.has-submenu .submenu li a {
    padding-left: 40px;
    font-size: 14px;
}

.has-submenu.active .submenu {
    display: block;
}

.arrow {
    float: right;
    font-size: 12px;
    transition: transform 0.3s;
}

.has-submenu.active .arrow {
    transform: rotate(180deg);
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.overlay.active {
    display: block;
}

/* --- Main Wrapper & Top Nav --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: margin-left 0.3s;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-color);
    padding: 10px 20px;
    box-shadow: var(--shadow);
    height: 80px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

/* Secondary Navigation Bar */
.secondary-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Align tabs to bottom */
    background-color: var(--primary-color);
    padding: 15px 20px 0 20px;
    /* Added top padding */
    height: 65px;
    /* Increased height */
    box-sizing: border-box;
    position: sticky;
    top: 80px;
    z-index: 99;
}

.secondary-nav .nav-links {
    display: flex;
    align-items: flex-end;
    /* Align tabs to bottom */
    gap: 5px;
    height: 100%;
}

.secondary-nav .nav-link:not(.logout-link) {
    color: white;
    text-decoration: none;
    padding: 12px 20px 10px 20px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    margin-right: 3px;
    /* Folder tab shape with rounded bottom corners */
    clip-path: polygon(
        8px 0%,
        calc(100% - 8px) 0%,
        100% calc(100% - 4px),
        100% 100%,
        calc(100% - 4px) 100%,
        4px 100%,
        0% 100%,
        0% calc(100% - 4px)
    );
    border-radius: 4px;
}

.secondary-nav .logout-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.2s;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    /* Align with center of tabs roughly */
}

.secondary-nav .logout-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.secondary-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.secondary-nav .nav-link.active {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-weight: 600;
    transform: translateY(-2px);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.secondary-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.secondary-nav .nav-switch {
    margin: 0;
}

.secondary-nav .nav-switch .slider {
    background-color: rgba(255, 255, 255, 0.3);
}

.secondary-nav .nav-switch input:checked+.slider {
    background-color: rgba(255, 255, 255, 0.5);
}

.secondary-nav .logout-link {
    opacity: 0.9;
}

.secondary-nav .logout-link:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Dropdown in secondary nav */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.nav-dropdown .dropdown-toggle .arrow {
    font-size: 0.7em;
    transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-toggle .arrow {
    transform: rotate(180deg);
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--surface-color);
    min-width: 180px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 5px 0;
    padding-top: 10px;
    margin-top: 0;
}

.nav-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    display: block;
}

.nav-dropdown .dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.nav-dropdown .dropdown-item:hover {
    background-color: var(--bg-color);
}

.nav-dropdown .dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

.nav-dropdown .add-subject-item {
    color: var(--primary-color);
    font-weight: 500;
}

.user-greeting {
    color: var(--text-color);
    font-size: 1.15em;
    font-weight: 500;
    margin-right: 15px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background-color: #e0f7fa;
    margin-right: 8px;
}

.logo-text {
    font-size: 1.68em;
    font-weight: 700;
    color: var(--text-color);
}

/* Menu button hidden - using top nav */
.menu-btn {
    display: none;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-center h1 {
    margin: 0;
    font-size: 1.8em;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-placeholder {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.logo-link {
    text-decoration: none;
}

.content-container {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* --- Layout Grid --- */
.main-container {
    display: flex;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.full-width-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bottom-panel {
    width: 100%;
    margin-top: 30px;
}

/* --- Components --- */
h2 {
    color: var(--text-color);
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Cards / Sections */
.action-bar,
.table-container,
.predictor-section,
.category-section {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: background-color 0.3s;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    margin-top: 10px;
    /* Removed margin since it's in a flex gap now */
}

.category-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-color);
}

th {
    background-color: #d6f8ff;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
}

body.dark-mode th {
    background-color: #004b62;
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Buttons */
button,
.action-btn,
.subject-action-btn,
.grade-lock-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

button:active {
    transform: translateY(1px);
}

#addRowBtn,
#addCategoryBtn,
#addPredictionBtn,
.add-prediction-btn,
#predict-btn,
#subject-modal-confirm {
    background-color: #006a8a;
    color: white;
}

#addRowBtn:hover,
#addCategoryBtn:hover,
#addPredictionBtn:hover,
.add-prediction-btn:hover,
#predict-btn:hover,
#subject-modal-confirm:hover {
    background-color: #005570;
}

/* Dark mode add buttons - lighter shade */
body.dark-mode #addRowBtn,
body.dark-mode #addCategoryBtn,
body.dark-mode #addPredictionBtn,
body.dark-mode .add-prediction-btn,
body.dark-mode #subject-modal-confirm {
    background-color: #00a8d6;
    color: white;
}

body.dark-mode #addRowBtn:hover,
body.dark-mode #addCategoryBtn:hover,
body.dark-mode #addPredictionBtn:hover,
body.dark-mode .add-prediction-btn:hover,
body.dark-mode #subject-modal-confirm:hover {
    background-color: #00c4f5;
}

/* Toasty light mode add buttons - warm brown/orange */
body.toasty-mode #addRowBtn,
body.toasty-mode #addCategoryBtn,
body.toasty-mode #addPredictionBtn,
body.toasty-mode .add-prediction-btn,
body.toasty-mode #subject-modal-confirm {
    background-color: #8b4513;
    color: white;
}

body.toasty-mode #addRowBtn:hover,
body.toasty-mode #addCategoryBtn:hover,
body.toasty-mode #addPredictionBtn:hover,
body.toasty-mode .add-prediction-btn:hover,
body.toasty-mode #subject-modal-confirm:hover {
    background-color: #6b3410;
}

/* Toasty dark mode add buttons - lighter warm shade */
body.toasty-mode.dark-mode #addRowBtn,
body.toasty-mode.dark-mode #addCategoryBtn,
body.toasty-mode.dark-mode #addPredictionBtn,
body.toasty-mode.dark-mode .add-prediction-btn,
body.toasty-mode.dark-mode #subject-modal-confirm {
    background-color: #d2691e;
    color: white;
}

body.toasty-mode.dark-mode #addRowBtn:hover,
body.toasty-mode.dark-mode #addCategoryBtn:hover,
body.toasty-mode.dark-mode #addPredictionBtn:hover,
body.toasty-mode.dark-mode .add-prediction-btn:hover,
body.toasty-mode.dark-mode #subject-modal-confirm:hover {
    background-color: #e07b39;
}

.delete-btn,
#deleteSelectedBtn,
.delete-subject-btn {
    background-color: var(--danger-color);
    color: white;
}

.delete-btn:hover,
#deleteSelectedBtn:hover,
.delete-subject-btn:hover {
    background-color: #c53030;
}

.edit-btn {
    background-color: var(--accent-color);
    color: white;
    margin-right: 5px;
}

.edit-btn:hover {
    background-color: #5a67d8;
}

body.dark-mode .edit-btn {
    background-color: #5a67d8;
}

body.dark-mode .edit-btn:hover {
    background-color: #4a56c8;
}

/* Retire subject button - black text in dark mode */
body.dark-mode #retire-subject-btn {
    color: #000 !important;
}

.grade-lock-btn {
    background-color: var(--text-secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.grade-lock-btn.lock-on {
    background-color: var(--success-color);
}

.grade-lock-btn.lock-off {
    background-color: #0081a7;
}

/* Inputs & Selects */
input[type="text"],
input[type="number"],
select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
}

/* Prediction Name Cell - Contenteditable styling to match input fields */
.prediction-name-cell {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    min-width: 150px;
    width: 150px;
    display: inline-block;
    vertical-align: middle;
    cursor: text;
    outline: none;
    transition: border-color 0.2s;
    text-align: left;
    margin-top: 12px;
}

.prediction-name-cell:focus {
    border-color: var(--primary-color);
}

.prediction-name-cell:empty:before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Predictor Section Specifics */
.predictor-section h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.predictor-section table {
    display: table;
    width: 100%;
}

.predictor-section thead {
    display: table-header-group;
}

.predictor-section tbody,
.predictor-section tr {
    display: table-row;
}

.predictor-section td {
    display: table-cell;
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
}

.predictor-section td::before {
    content: none;
}

.predictor-section input,
.predictor-section select {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-color);
}

.predictor-section .action-btn {
    width: auto;
    margin-bottom: 0;
}

/* Modals - See PROFESSIONAL UI section for modal styles */
.modal-content .modal-buttons button:nth-child(1) {
    background: var(--danger-color, #dc3545);
    color: white;
}
.modal-content .modal-buttons button:nth-child(2) {
    background: var(--neutral-color, #6c757d);
    color: white;
}

/* Utilities */
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background-color: var(--bg-color);
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text-color);
}

.category-tag svg {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Specific overrides/additions */
.calculated-weight {
    color: var(--text-secondary);
    font-style: italic;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-form label {
    font-weight: 600;
    color: var(--text-color);
}

.filter-form select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Table Wrapper - Contains the single table with scrolling tbody */
.table-wrapper {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--surface-color);
    margin-bottom: 1em;
    overflow: hidden;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
}

.table-wrapper thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #d6f8ff;
}

.table-wrapper thead th {
    background-color: #d6f8ff;
    border-bottom: none;
    padding: 12px 15px;
}

/* Summary Row - Inside thead, so it sticks together with header */
.table-wrapper thead .summary-row td {
    background-color: #d6f8ff;
    font-weight: bold;
    border-top: none;
    border-bottom: 2px solid var(--border-light);
    padding: 12px 15px;
}

body.dark-mode .table-wrapper thead {
    background-color: #004b62;
}

body.dark-mode .table-wrapper thead th {
    background-color: #004b62;
}

body.dark-mode .table-wrapper thead .summary-row td {
    background-color: #004b62;
}

th:last-child,
td:last-child {
    width: 1%;
    white-space: nowrap;
}

/* Validation and On-Page Alerts */
.is-invalid,
.input-error {
    border: 2px solid var(--danger-color) !important;
    background-color: #fff5f5;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.15);
    border-radius: 8px;
}

/* Toast styles moved to PROFESSIONAL UI section */

/* --- Stats Page --- */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.stats-lede {
    margin: 6px 0 0;
    color: var(--text-secondary);
}

.stats-tag {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 14px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.stats-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -4px;
    flex-wrap: wrap;
}

.toggle-group {
    display: inline-flex;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-color);
    box-shadow: var(--shadow);
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border-light);
}

.threshold-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.threshold-controls.inline {
    gap: 8px;
    align-items: center;
}

.threshold-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.threshold-group input {
    padding: 6px 8px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-color);
}

.pill-btn {
    border: none;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: var(--shadow);
}

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

.threshold-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.stats-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.stats-card {
    background: var(--surface-color);
    padding: 18px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

body.dark-mode .stats-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.metric-card .metric-value {
    font-size: 2rem;
    margin: 6px 0;
    font-weight: 700;
    transition: transform 0.3s ease, color 0.3s ease;
}

.stats-card:hover .metric-value {
    transform: scale(1.05);
    color: var(--primary-color);
}

.stat-subtext {
    color: var(--text-secondary);
    margin: 0;
}

.card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pill {
    background: rgba(74, 144, 226, 0.12);
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.2s ease, transform 0.2s ease;
}

.stats-card:hover .pill {
    background: rgba(74, 144, 226, 0.2);
    transform: scale(1.02);
}

.pill.danger {
    background: rgba(229, 62, 62, 0.1);
    color: var(--danger-color);
}

.stats-card:hover .pill.danger {
    background: rgba(229, 62, 62, 0.18);
}

.stat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.015);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    cursor: default;
}

.stat-list li:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark-mode .stat-list li {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .stat-list li:hover {
    background: rgba(74, 144, 226, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-list-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.mini {
    font-size: 0.85em;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.muted {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.big-number {
    font-size: 2rem;
    margin: 0 0 6px;
    font-weight: 700;
}

.danger-text {
    color: var(--danger-color);
}

.hint {
    color: var(--text-secondary);
    margin: 8px 0 0;
}

.empty-state {
    border: 1px dashed var(--border-light);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: var(--surface-color);
    box-shadow: var(--shadow);
}

/* Modal styles moved to PROFESSIONAL UI section */

/* --- Prediction Styles --- */
.prediction-row {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 3px solid var(--secondary-color);
}

body.dark-mode .prediction-row {
    background-color: rgba(52, 152, 219, 0.2);
}

.prediction-row td {
    white-space: nowrap;
    vertical-align: middle;
}

.prediction-input {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

.predicted-value {
    color: var(--success-color);
    font-weight: 600;
    border-color: var(--success-color) !important;
}

.predict-btn {
    background-color: #5a9bd5;
    color: white;
    margin-right: 5px;
}

.predict-btn:hover {
    background-color: #4a87be;
}

/* Toasty light mode predict button - orange */
body.toasty-mode .predict-btn {
    background-color: #e07b39;
    color: white;
}

body.toasty-mode .predict-btn:hover {
    background-color: #c9692e;
}

.add-prediction-btn {
    background-color: #2980b9;
    color: white;
    margin-right: 5px;
    border: 1px solid #1f6391;
}

.add-prediction-btn:hover {
    background-color: #1f6391;
}

/* Active Prediction Summary Style */
.show-predictions-active {
    color: var(--accent-color) !important;
    font-weight: bold;
}

.delete-subject-bar {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    padding: 0 6px;
}

.dragging {
    opacity: 0.6;
}

.placeholder {
    height: 48px;
    outline: 2px dashed var(--border-light);
}


tbody#study-table-body tr {
    transition: transform 120ms ease;
}

/* (optional) small hint in header, used in step 4) */
.drag-col-hint {
    font-size: 12px;
    opacity: 0.6;
    margin-right: 6px;
    vertical-align: middle;
}

/* Dashboard-specific table styling */
/* Add spacing to the left of Subject column (2nd column) */
.dashboard-view .table-wrapper table th:nth-child(2),
.dashboard-view .table-wrapper table td:nth-child(2) {
    padding-left: 20px;
}

/* Add spacing to the right of Weight column (last column on dashboard) */
.dashboard-view .table-wrapper table th:last-child,
.dashboard-view .table-wrapper table td:last-child {
    padding-right: 24px;
}

/* Add more space between drag handle and subject on dashboard */
.dashboard-view .table-wrapper table td:first-child {
    padding-right: 12px;
}

/* ============================================
   LANDING PAGE STYLES - Vertical Scroll
   ============================================ */

html:has(.landing-page) {
    background: #1a1a2e;
    overscroll-behavior: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html:has(.landing-page)::-webkit-scrollbar {
    display: none;
}

.landing-page {
    margin: 0;
    padding: 0;
    color: #ffffff;
    font-family: 'Merriweather', serif;
    overflow-x: hidden;
    background: #1a1a2e;
    /* Hide scrollbar but allow scrolling */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.landing-page::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Prevent overscroll bounce */
.landing-page {
    overscroll-behavior: none;
}

/* Fixed Header */
.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Merriweather', serif;
}

.landing-header.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.landing-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-header-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.landing-header-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
}

.landing-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.landing-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1001;
}

.landing-header-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1001;
}

.landing-header-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.landing-header-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1001;
}

.landing-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

/* Theme toggle link in header */
.landing-header-right .theme-toggle-link {
    margin-top: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
}

/* Scroll Progress Bar */
.scroll-progress-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 999;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.1s ease-out;
}

/* Vertical Scroll Container */
.vertical-scroll-container {
    width: 100%;
    background: #1a1a2e;
}

/* Each scroll section */
.scroll-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 80%, #0f3460 100%);
    padding-top: 70px;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    padding: 20px;
}

.hero-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.hero-logo-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #a8d8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 40px 0;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

.scroll-arrow {
    font-size: 1.5rem;
    animation: bounce 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 10;
    border: none;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Demo Section */
.demo-section {
    background: linear-gradient(180deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
}

.demo-container {
    max-width: 900px;
    width: 90%;
    text-align: center;
}

.demo-title {
    font-size: 2.5rem;
    margin: 0 0 60px 0;
    color: #ffffff;
}

.demo-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.demo-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.demo-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.demo-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
}

.play-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Features Section */
.features-section {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.features-container {
    max-width: 1100px;
    width: 90%;
    padding: 40px 20px;
}

.features-title {
    font-size: 2.5rem;
    text-align: center;
    margin: 0 0 40px 0;
    color: #ffffff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.feature-card h3 {
    font-size: 1.15rem;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.feature-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
}

/* Theme-specific icons */
.feature-icon .icon-frosty {
    display: block;
}

.feature-icon .icon-toasty {
    display: none;
}

.landing-toasty .feature-icon .icon-frosty {
    display: none;
}

.landing-toasty .feature-icon .icon-toasty {
    display: block;
}

.theme-toggle-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f7a08e 0%, #d2691e 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.theme-toggle-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(210, 105, 30, 0.4);
}

.landing-toasty .theme-toggle-link {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.landing-toasty .theme-toggle-link:hover {
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

/* ============================================
   LANDING PAGE TOASTY THEME
   ============================================ */

html:has(.landing-page.landing-toasty) {
    background: #611700;
}

.landing-page.landing-toasty {
    background: #611700;
}

.landing-page.landing-toasty .hero-section {
    background: linear-gradient(180deg, #8b2000 0%, #611700 50%, #3d0d00 100%);
}

.landing-page.landing-toasty .demo-section {
    background: linear-gradient(180deg, #3d0d00 0%, #611700 50%, #8b2000 100%);
}

.landing-page.landing-toasty .features-section {
    background: linear-gradient(180deg, #8b2000 0%, #611700 50%, #3d0d00 100%);
}

.landing-page.landing-toasty .cta-section {
    background: linear-gradient(180deg, #3d0d00 0%, #611700 50%, #8b2000 100%);
}

.landing-page.landing-toasty .landing-header.scrolled {
    background: rgba(97, 23, 0, 0.95);
}

.landing-page.landing-toasty .landing-header-btn {
    background: linear-gradient(135deg, #f7a08e 0%, #d2691e 100%);
}

.landing-page.landing-toasty .landing-header-btn:hover {
    background: linear-gradient(135deg, #d2691e 0%, #bd0600 100%);
    box-shadow: 0 6px 20px rgba(210, 105, 30, 0.4);
}

.landing-page.landing-toasty .btn-primary {
    background: linear-gradient(135deg, #f7a08e 0%, #d2691e 100%);
}

.landing-page.landing-toasty .btn-primary:hover {
    background: linear-gradient(135deg, #d2691e 0%, #bd0600 100%);
}

.landing-page.landing-toasty .btn-secondary {
    border-color: #f7a08e;
    color: #f7a08e;
}

.landing-page.landing-toasty .btn-secondary:hover {
    background: rgba(247, 160, 142, 0.1);
}

.landing-page.landing-toasty .feature-card {
    background: rgba(253, 234, 231, 0.08);
    border-color: rgba(247, 160, 142, 0.2);
}

.landing-page.landing-toasty .feature-card:hover {
    background: rgba(253, 234, 231, 0.12);
}

.landing-page.landing-toasty .nav-dot {
    border-color: rgba(247, 160, 142, 0.5);
}

.landing-page.landing-toasty .nav-dot.active {
    background: #f7a08e;
    border-color: #f7a08e;
}

.landing-page.landing-toasty .scroll-progress-bar {
    background: linear-gradient(90deg, #f7a08e, #d2691e);
}

.landing-page.landing-toasty .cta-login a {
    color: #f7a08e;
}

.landing-page.landing-toasty .demo-video-placeholder {
    background: rgba(253, 234, 231, 0.05);
    border-color: rgba(247, 160, 142, 0.2);
}

/* Prediction Preview Section */
.prediction-preview-section {
    background: linear-gradient(180deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
}

.prediction-preview-container {
    max-width: 1080px;
    width: 90%;
    text-align: center;
}

.prediction-preview-title {
    font-size: 2.5rem;
    margin: 0 0 60px 0;
    color: #ffffff;
}

.prediction-video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 0 20px rgba(79, 172, 254, 0.4),
        0 0 40px rgba(79, 172, 254, 0.2),
        0 0 60px rgba(79, 172, 254, 0.1);
    border: 5px solid rgba(79, 172, 254, 0.6);
    transition: all 0.3s ease;
}

.prediction-video-wrapper:hover {
    box-shadow: 
        0 0 30px rgba(79, 172, 254, 0.5),
        0 0 60px rgba(79, 172, 254, 0.3),
        0 0 90px rgba(79, 172, 254, 0.15);
    border-color: rgba(79, 172, 254, 0.8);
}

.prediction-video {
    width: 100%;
    display: block;
    border-radius: 13px;
}

.prediction-preview-caption {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 16px 0 0 0;
}

.prediction-preview-caption:first-of-type {
    margin-top: 40px;
}

/* Toasty theme for prediction preview */
.landing-page.landing-toasty .prediction-preview-section {
    background: linear-gradient(180deg, #3d0d00 0%, #611700 50%, #8b2000 100%);
}

.landing-page.landing-toasty .prediction-video-wrapper {
    box-shadow: 
        0 0 20px rgba(247, 160, 142, 0.4),
        0 0 40px rgba(247, 160, 142, 0.2),
        0 0 60px rgba(247, 160, 142, 0.1);
    border-color: rgba(247, 160, 142, 0.6);
}

.landing-page.landing-toasty .prediction-video-wrapper:hover {
    box-shadow: 
        0 0 30px rgba(247, 160, 142, 0.5),
        0 0 60px rgba(247, 160, 142, 0.3),
        0 0 90px rgba(247, 160, 142, 0.15);
    border-color: rgba(247, 160, 142, 0.8);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.cta-container {
    max-width: 600px;
    text-align: center;
    padding: 20px;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin: 0 0 16px 0;
    color: #ffffff;
}

.cta-container>p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 32px 0;
}

.cta-container>.btn {
    margin-bottom: 30px;
}

.cta-login {
    margin-top: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.cta-login a {
    color: #4facfe;
    text-decoration: none;
}

.cta-login a:hover {
    text-decoration: underline;
}

/* Footer in CTA section */
.cta-section .footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 60px;
    opacity: 0.6;
}

.footer-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Navigation Dots - Vertical on right side */
.scroll-nav-dots {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.nav-dot.active {
    background: #4facfe;
    box-shadow: 0 0 12px rgba(79, 172, 254, 0.6);
}

/* Landing Page Responsive */
@media (max-width: 768px) {
    .landing-header {
        padding: 0 20px;
        height: 60px;
    }

    .landing-header-title {
        font-size: 1.2rem;
    }

    .landing-header-logo {
        width: 30px;
        height: 30px;
    }

    .landing-header-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .hero-section {
        padding-top: 60px;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .hero-logo-img {
        width: 90px;
        height: 90px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .features-container {
        padding: 20px;
    }

    .scroll-nav-dots {
        right: 15px;
        gap: 12px;
    }

    .nav-dot {
        width: 10px;
        height: 10px;
    }

    .scroll-hint {
        bottom: 20px;
    }

    .scroll-progress-container {
        top: 60px;
    }

    .demo-title,
    .features-title,
    .cta-section h2,
    .prediction-preview-title {
        font-size: 1.8rem;
    }

    .prediction-preview-container {
        padding: 20px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
        max-width: 280px;
    }

    .cta-container>p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .landing-header {
        padding: 0 15px;
    }

    .landing-header-title {
        font-size: 1rem;
    }

    .landing-header-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .landing-header-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-tagline {
        font-size: 1rem;
        padding: 0 10px;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        width: 52px;
        height: 52px;
    }

    .feature-card h3 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: 0.85rem;
    }
}

/* ============================================
   LANDING PAGE ANIMATIONS
   ============================================ */

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hero animations */
.hero-logo-img {
    animation: scaleIn 0.8s ease-out;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-tagline {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.scroll-hint {
    animation: fadeIn 1s ease-out 1.2s both;
}

/* Scroll reveal classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation for feature cards */
.feature-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, background 0.3s ease, box-shadow 0.3s ease;
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:nth-child(1) {
    transition-delay: 0.1s;
}

.feature-card:nth-child(2) {
    transition-delay: 0.2s;
}

.feature-card:nth-child(3) {
    transition-delay: 0.3s;
}

.feature-card:nth-child(4) {
    transition-delay: 0.4s;
}

.feature-card:nth-child(5) {
    transition-delay: 0.5s;
}

.feature-card:nth-child(6) {
    transition-delay: 0.6s;
}

/* Demo video hover effect */
.demo-video-wrapper {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.demo-video-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Floating animation for logo */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-logo-img {
    animation: float 4s ease-in-out infinite, scaleIn 0.8s ease-out;
}

/* Gradient animation for hero title */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-title {
    background: linear-gradient(135deg, #ffffff 0%, #a8d8ff 25%, #ffffff 50%, #a8d8ff 75%, #ffffff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out 0.2s both, gradientShift 8s ease infinite;
}

/* Navigation dot pulse on active */
.nav-dot.active {
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(79, 172, 254, 0.6);
    }

    50% {
        box-shadow: 0 0 20px rgba(79, 172, 254, 0.9);
    }
}

/* Smooth section transitions */
.scroll-section {
    transition: opacity 0.3s ease;
}

/* Header transition enhancement */
.landing-header {
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* CTA section animations */
.cta-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.cta-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Demo section animations */
.demo-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.demo-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Public Navigation (for non-logged-in users on about page) */
.public-nav {
    background: #0081a7;
}

.public-nav h1 {
    color: #d6f8ff;
}

.public-nav .logo-text {
    color: #d6f8ff;
}

.landing-about {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding-top: 0;
    font-family: 'Merriweather', serif;
}

.landing-about .content-container {
    padding-top: 30px;
}

.landing-about .main-container {
    color: #d6f8ff;
}

.landing-about .left-panel h2 {
    color: #d6f8ff;
}

.landing-about .left-panel p,
.landing-about .left-panel li {
    color: #ffffff;
    font-size: 1.125rem;
}

.landing-about .left-panel li {
    margin-bottom: 12px;
}

.landing-about .left-panel ul {
    margin-bottom: 24px;
}

/* Team Photo Styles */
.team-photo-container {
    margin: 24px 0 32px 0;
    text-align: left;
}

.team-photo {
    max-width: 100%;
    width: 600px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.team-photo:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.team-photo-caption {
    margin-top: 12px;
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

/* About Page Section Animations */
.left-panel h2 {
    opacity: 0;
    animation: aboutFadeIn 0.6s ease forwards;
}

.left-panel p {
    opacity: 0;
    animation: aboutFadeIn 0.6s ease forwards;
}

.left-panel ul {
    opacity: 0;
    animation: aboutFadeIn 0.6s ease forwards;
}

.left-panel h2:nth-of-type(1) { animation-delay: 0.1s; }
.left-panel .team-photo-container { animation: aboutFadeIn 0.6s 0.2s ease forwards; opacity: 0; }
.left-panel h2:nth-of-type(2) { animation-delay: 0.3s; }
.left-panel p:nth-of-type(1) { animation-delay: 0.4s; }
.left-panel p:nth-of-type(2) { animation-delay: 0.5s; }
.left-panel h2:nth-of-type(3) { animation-delay: 0.6s; }
.left-panel p:nth-of-type(3) { animation-delay: 0.7s; }
.left-panel ul { animation-delay: 0.8s; }
.left-panel h2:nth-of-type(4) { animation-delay: 0.9s; }
.left-panel p:nth-of-type(4) { animation-delay: 1.0s; }
.left-panel h2:nth-of-type(5) { animation-delay: 1.1s; }
.left-panel p:nth-of-type(5) { animation-delay: 1.2s; }

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

/* About Page List Items Dynamic Effects */
.left-panel li {
    transition: transform 0.2s ease, color 0.2s ease;
}

.left-panel li:hover {
    transform: translateX(8px);
    color: var(--primary-color);
}

.about-public .left-panel li:hover {
    color: #7dd3fc;
}

.about-public.landing-toasty .left-panel li:hover {
    color: #fca5a5;
}

.main-wrapper:not(.landing-about) .team-photo-caption {
    color: var(--text-secondary);
}

/* Logged-in About Page - Match public page text/spacing */
.main-wrapper:not(.landing-about) .left-panel p,
.main-wrapper:not(.landing-about) .left-panel li {
    font-size: 1.125rem;
    line-height: 1.6;
}

.main-wrapper:not(.landing-about) .left-panel li {
    margin-bottom: 12px;
}

.main-wrapper:not(.landing-about) .left-panel ul {
    margin-bottom: 24px;
}

/* About Public Page Styles */
.about-public {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding-top: 70px;
}

.about-public .landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

/* Toasty theme for public about page */
.about-public.landing-toasty {
    background: linear-gradient(135deg, #611700 0%, #8b2000 50%, #3d0d00 100%);
}

.about-public.landing-toasty .landing-about {
    background: transparent;
}

.about-public.landing-toasty .landing-about .main-container,
.about-public.landing-toasty .landing-about .left-panel h2 {
    color: #fdeae7;
}

.about-public.landing-toasty .landing-about .left-panel p,
.about-public.landing-toasty .landing-about .left-panel li {
    color: #fdeae7;
}

.about-public.landing-toasty .landing-header.scrolled {
    background: rgba(97, 23, 0, 0.95);
}

.about-public.landing-toasty .landing-header-btn {
    background: linear-gradient(135deg, #f7a08e 0%, #d2691e 100%);
}

.about-public.landing-toasty .landing-header-btn:hover {
    background: linear-gradient(135deg, #d2691e 0%, #bd0600 100%);
    box-shadow: 0 6px 20px rgba(210, 105, 30, 0.4);
}

.nav-btn {
    padding: 8px 16px;
    text-decoration: none;
    color: #d6f8ff;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
}

.nav-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.nav-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* --- Staggered Entrance Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-enter {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Start hidden */
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

/* ============================================
   PROFESSIONAL UI ENHANCEMENTS
   ============================================ */

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.success::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.error::before {
    content: "✕";
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.warning::before {
    content: "!";
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.toast.info {
    border-left-color: var(--primary-color);
    color: var(--text-color);
}

.toast.info::before {
    content: "i";
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    max-width: 24px;
    min-height: 24px;
    max-height: 24px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    font-style: italic;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

/* --- Loading States --- */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, 
        var(--surface-color) 25%, 
        var(--border-light) 50%, 
        var(--surface-color) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 60%;
}

/* --- Empty States --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.empty-state p {
    margin: 0 0 24px 0;
    font-size: 1rem;
    max-width: 400px;
}

.empty-state .btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-state .btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* --- Form Validation --- */
.form-group {
    position: relative;
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface-color);
    color: var(--text-color);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--border-light);
}

.form-input.valid {
    border-color: var(--success-color);
}

.form-input.invalid {
    border-color: var(--danger-color);
}

.validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.validation-icon.valid::after {
    content: "✓";
    color: var(--success-color);
}

.validation-icon.invalid::after {
    content: "✕";
    color: var(--danger-color);
}

.validation-message {
    font-size: 0.85rem;
    margin-top: 4px;
    color: var(--danger-color);
    display: none;
}

.form-input.invalid + .validation-message {
    display: block;
}

/* --- Dashboard Overview Cards --- */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #d6f8ff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

body.dark-mode .dashboard-card {
    background: #004b62;
}

body.toasty-mode .dashboard-card {
    background: #fff0e6;
}

body.toasty-mode.dark-mode .dashboard-card {
    background: #5c3d2e;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dashboard-card-icon {
    font-size: 1.1rem;
    margin-left: 6px;
}

.dashboard-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.dashboard-card-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.dashboard-card-icon {
    font-size: 1.1rem;
    margin-left: 6px;
}

/* --- Confirmation Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-icon.warning {
    color: #f59e0b;
}

.modal-icon.danger {
    color: var(--danger-color);
}

.modal-content h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.modal-content p {
    margin: 0 0 24px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn-cancel {
    background: var(--border-light);
    color: var(--text-color);
}

.modal-btn-cancel:hover {
    background: var(--border-color);
    color: white;
}

.modal-btn-confirm {
    background: var(--danger-color);
    color: white;
}

.modal-btn-confirm:hover {
    filter: brightness(1.1);
}

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

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

/* ID-based modal button fallbacks */
#confirm-delete,
#modal-confirm-yes {
    background-color: var(--danger-color);
    color: white;
}

#modal-confirm-yes:hover {
    background-color: #c53030;
}

#cancel-delete,
#subject-modal-cancel,
#modal-confirm-no {
    background-color: var(--text-secondary);
    color: white;
}

/* --- Page Transitions --- */
.page-transition {
    animation: pageEnter 0.4s ease-out;
}

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

/* --- Smooth Table Row Animations --- */
.table-row-enter {
    animation: rowEnter 0.3s ease-out;
}

@keyframes rowEnter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.table-row-exit {
    animation: rowExit 0.3s ease-out forwards;
}

@keyframes rowExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}