body,
ul,
ol,
li,
dl,
dt,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
textarea,
p {
    margin: 0 auto;
    padding: 0px;
    list-style-type: none;
}

ul {
    list-style: none;
}

img,
a img {
    border: none;
}

a {
    text-decoration: none;
    color: #000;
}

a:hover {
    text-decoration: none;
}

/* Body background - moved from inline style */
body {
    background-image: url("../images/bg.jpg");
    overflow-x: hidden;
}

/* Matrix Rain Canvas Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Visually hidden for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #a3001b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #fff;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
}

/* Error Toast Styles */
.error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #a3001b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.error-toast.show {
    display: block;
    opacity: 1;
}

.error-toast .error-message {
    font-size: 14px;
}

/* Language and Source select - moved from inline style */
#languages,
#source {
    width: 50%;
    cursor: pointer;
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid #a3001b;
    outline-offset: 2px;
}

*:focus-visible {
    outline: 2px solid #a3001b;
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(163, 0, 27, 0.5);
}

/* Scroll animation - fade in */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Button hover effects */
.stylebtn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.stylebtn:hover {
    transform: translateY(-2px);
}

.stylebtn:active {
    transform: translateY(0);
}

/* Touch target size - minimum 44x44px for mobile */
@media (hover: none) and (pointer: coarse) {
    button,
    .stylebtn,
    #main button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Keyboard shortcut modal */
.keyboard-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    max-width: 400px;
    width: 90%;
    display: none;
}

.keyboard-modal.show {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.keyboard-modal h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #a3001b;
}

.keyboard-modal ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.keyboard-modal li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.keyboard-modal li:last-child {
    border-bottom: none;
}

.keyboard-modal .key {
    background: #333;
    padding: 4px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid #555;
}

.keyboard-modal .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: auto;
}

.keyboard-modal .close-btn:hover {
    color: #fff;
}

/* Shortcuts section styling */
.shortcuts-section {
    margin-bottom: 16px;
}

.shortcuts-section:last-child {
    margin-bottom: 0;
}

.shortcuts-section h4 {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
    padding-bottom: 4px;
    border-bottom: 1px solid #333;
}

.shortcuts-section ul {
    margin: 0;
    padding: 0;
}

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

.modal-overlay.show {
    display: block;
}

/* User guide tooltip */
.guide-tooltip {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #a3001b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    display: none;
    animation: slideInRight 0.5s ease;
}

.guide-tooltip.show {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.guide-tooltip .close-guide {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: auto;
    opacity: 0.7;
}

.guide-tooltip .close-guide:hover {
    opacity: 1;
}

/* Enhanced guide tooltip content */
.guide-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guide-title {
    font-size: 14px;
    font-weight: 600;
}

.guide-text {
    font-size: 12px;
    opacity: 0.9;
}

/* Guide tooltip responsive */
@media screen and (max-width: 576px) {
    .guide-tooltip {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 10px 16px;
    }
    
    .guide-content {
        gap: 2px;
    }
    
    .guide-title {
        font-size: 13px;
    }
    
    .guide-text {
        font-size: 11px;
    }
}

/* Card hover effect */
#four_flash .flashBg ul.mobile li {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#four_flash .flashBg ul.mobile li:hover {
    transform: scale(1.05);
    opacity: 1;
}

.bodyCon08 {
    background: none
}

.bodyCon08 .students {
    margin: 0 auto;
    width: auto;
    position: relative;
    display: table-cell;
    vertical-align: middle;
    height: 100vh;
    background-color: #00000066;
}

#four_flash {
    position: relative;
    width: auto;
    margin: 0 auto;
}

#four_flash .flashBg {
    width: 100vw;
    height: auto;
    margin: 0 auto;
    display: inline-table;
}

#four_flash .flashBg ul.mobile {
    height: 280px;
    left: 0;
}

#four_flash .flashBg ul.mobile li {
    float: left;
    width: 25%;
    height: 100%;
    opacity: 0.8;
    padding-top: 40px;
}

#four_flash .flashBg ul.mobile li:hover {
    color: #fff;
}

#four_flash .flashBg ul.mobile li img {
    width: 140px;
    height: 140px;
    display: block;
    margin: 0 auto;
    border: 10px solid #dadce3;
    border-radius: 82px;
}

#four_flash .flashBg ul.mobile li dd {
    font-size: 20px;
    width: 250px;
    line-height: 60px;
    text-align: center;
    border-bottom: 1px solid #dadce3;
    color: #ffffff;
}

#four_flash .flashBg ul.mobile li p {
    font-size: 16px;
    text-align: center;
    width: 250px;
    line-height: 24px;
    margin-top: 10px;
    color: #ffffff98;
}


/* This is switch css style start */

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

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

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}


/* This is switch css style end */


/* This is popupbox css style start */

#popupbox,
#logbox,
#sourcebox,
#infobox {
    width: 100%;
    height: 100%;
    position: absolute;
    visibility: hidden;
    display: none;
    background-color: rgba(22, 22, 22, 0.5);
}

#popupbox:target,
#logbox:target,
#sourcebox:target,
#infobox:target {
    visibility: visible;
    display: block;
}

#logbox p,
#infobox p {
    padding-bottom: 10px;
    word-break: break-word;
}

.scrollidbar,
.scrollappbar {
    text-align: left;
    overflow-y: auto;
    height: inherit;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

::-webkit-scrollbar {
    display: none;
}

.circlescon {
    display: flex;
    padding-bottom: 5px;
}

.circlescon li {
    width: 100%;
    height: 50px;
    text-align: center;
    background-color: #fff;
    margin-right: 10px;
    cursor: pointer;
}

.qrcode {
    position: absolute;
    background-color: ivory;
    width: 50%;
    height: 30%;
    left: 24%;
    display: none;
}

.circlescon li img {
    width: 70%;
    height: 50px;
}

.reveal-modal,
.log-modal,
.source-modal {
    color: #fff;
    background: #a3001b;
    margin: 0 auto;
    width: 250px;
    height: 250px;
    position: relative;
    z-index: 41;
    top: 35%;
    padding: 10px;
    text-align: center;
    -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
}

.close-reveal-modal,
.close-log-modal,
.close-source-modal {
    position: relative;
    float: right;
    color: #fff;
}

#selectform {
    text-align: left;
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
}


/* This is popupbox css style end */


/* This is button css style start */

button {
    font-weight: 600;
    border: solid 2px #333;
    outline: 0;
    font-size: 1.5rem;
    letter-spacing: 0.08rem;
    background-color: white;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    width: 90%;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

button.stylebtn {
    background-color: white;
    border: 2px solid #333;
    color: #333;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

button.stylebtn:hover {
    background-color: #a3001b;
    border-color: #a3001b;
    color: white;
    box-shadow: 2px 2px 0px rgba(163, 0, 27, 0.4);
    transform: translate(2px, 2px);
}

button.stylebtn:active {
    background-color: #8a0016;
    border-color: #8a0016;
    box-shadow: 1px 1px 0px rgba(163, 0, 27, 0.5);
    transform: translate(3px, 3px);
}

/* Dark theme button styles */
[data-theme="dark"] button.stylebtn {
    background-color: #2a2a2a;
    border-color: #fff;
    color: #fff;
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] button.stylebtn:hover {
    background-color: #a3001b;
    border-color: #a3001b;
    color: #fff;
    box-shadow: 2px 2px 0px rgba(163, 0, 27, 0.4);
}


/* This is button css style end */


/* Settings Modal - Paginated Style */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
}

.settings-modal-overlay.show {
    display: block;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90%;
    max-width: 480px;
    height: auto;
    min-height: 500px;
    max-height: 85vh;
    background: linear-gradient(180deg, #1f1f1f 0%, #1a1a1a 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 10001;
    overflow: hidden;
    display: none;
}

.settings-modal.show {
    display: block;
    animation: modalFadeIn 0.35s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.settings-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.settings-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 800px;
    max-height: calc(85vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    visibility: hidden;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0s 0.35s;
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(163, 0, 27, 0.5) transparent;
}

.settings-page::-webkit-scrollbar {
    width: 5px;
}

.settings-page::-webkit-scrollbar-track {
    background: transparent;
}

.settings-page::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(163, 0, 27, 0.6) 0%, rgba(163, 0, 27, 0.3) 100%);
    border-radius: 10px;
}

.settings-page::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(163, 0, 27, 0.8) 0%, rgba(163, 0, 27, 0.5) 100%);
}

.settings-page[data-page="main"] {
    transform: translateX(0);
}

.settings-page[data-page="basic"],
.settings-page[data-page="advanced"],
.settings-page[data-page="appearance"],
.settings-page[data-page="source"],
.settings-page[data-page="about"] {
    transform: translateX(100%);
}

.settings-page.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0s 0s;
}

.settings-page.exiting {
    visibility: visible;
    transform: translateX(-25%);
    opacity: 0.4;
    pointer-events: none;
}

.settings-header {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-header .close-btn,
.settings-header .back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.settings-header .close-btn:hover,
.settings-header .back-btn:hover {
    background: rgba(163, 0, 27, 0.2);
    color: #fff;
    transform: scale(1.05);
}

.settings-header h2 {
    margin: 0;
    margin-left: 14px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.settings-nav {
    padding: 12px 0;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    margin: 4px 12px;
    border-radius: 12px;
}

.settings-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    border-radius: 0 2px 2px 0;
    transition: background 0.25s ease;
}

.settings-nav-item:hover {
    background: rgba(163, 0, 27, 0.1);
}

.settings-nav-item:hover::before {
    background: #a3001b;
}

.settings-nav-item:active {
    transform: scale(0.98);
}

.settings-nav-item .nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(163, 0, 27, 0.15);
    border-radius: 10px;
    margin-right: 14px;
    transition: all 0.25s ease;
}

.settings-nav-item:hover .nav-icon {
    background: rgba(163, 0, 27, 0.25);
    transform: scale(1.05);
}

.settings-nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
    color: #a3001b;
}

.settings-nav-item .nav-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.settings-nav-item .nav-arrow {
    color: #555;
    font-size: 18px;
    transition: transform 0.25s ease, color 0.25s ease;
}

.settings-nav-item:hover .nav-arrow {
    color: #a3001b;
    transform: translateX(3px);
}

.settings-nav-item .nav-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #a3001b 0%, #c41f37 100%);
    padding: 3px 8px;
    border-radius: 12px;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(163, 0, 27, 0.3);
}

.settings-content {
    padding: 20px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.25s ease;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item .item-label {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.settings-item .item-description {
    color: #777;
    font-size: 12px;
    margin-top: 4px;
}

.settings-item .item-control {
    display: flex;
    align-items: center;
}

/* Settings specific controls */
/* Settings Select Dropdown - Optimized */
.settings-select {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
    max-width: 200px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' 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 12px center;
    background-size: 12px;
    padding-right: 32px;
    transition: all 0.2s ease;
}

.settings-select:hover {
    background-color: #3a3a3a;
    border-color: #a3001b;
}

.settings-select:focus {
    outline: 2px solid #a3001b;
    outline-offset: 2px;
    border-color: #a3001b;
}

/* Language select optgroup styling */
.settings-select optgroup {
    background: #2a2a2a;
    color: #a3001b;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 0 4px 0;
}

.settings-select option {
    background: #333;
    color: #fff;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 400;
}

.settings-select option:hover,
.settings-select option:checked {
    background: #a3001b;
    color: #fff;
}

/* Language select container with search */
.language-select-container {
    position: relative;
    width: 100%;
}

.language-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #555;
    border-radius: 8px;
    background: #333;
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.language-search-input:focus {
    border-color: #a3001b;
    box-shadow: 0 0 0 2px rgba(163, 0, 27, 0.3);
}

.language-search-input::placeholder {
    color: #888;
}

.settings-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: auto;
    min-width: 80px;
}

.settings-btn:hover {
    background: #a3001b;
    border-color: #a3001b;
}

.settings-link {
    color: #a3001b;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.settings-link:hover {
    color: #c41f37;
}

/* Version info styling */
.settings-version {
    color: #888;
    font-size: 14px;
}

/* Social links in about page */
.settings-social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.settings-social-link {
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.settings-social-link:hover {
    background: #a3001b;
}

.settings-social-link img {
    width: 24px;
    height: 24px;
}

/* Dark theme for settings modal */
[data-theme="dark"] .settings-modal {
    background: #2a2a2a;
}

[data-theme="dark"] .settings-header {
    border-bottom-color: #444;
}

[data-theme="dark"] .settings-nav-item {
    border-bottom-color: #444;
}

[data-theme="dark"] .settings-item {
    border-bottom-color: #444;
}

[data-theme="dark"] .settings-select,
[data-theme="dark"] .settings-btn {
    background: #444;
    border-color: #666;
}

/* Responsive for settings modal */
@media screen and (max-width: 768px) {
    .settings-modal {
        max-width: 420px;
        min-height: 400px;
        max-height: 85vh;
    }
    
    .settings-header {
        padding: 16px;
    }
    
    .settings-header h2 {
        font-size: 18px;
    }
    
    .settings-nav-item {
        padding: 14px 16px;
    }
    
    .settings-nav-item .nav-title {
        font-size: 15px;
    }
    
    .settings-content {
        padding: 16px;
    }
}

@media screen and (max-width: 576px) {
    .settings-modal {
        max-width: calc(100vw - 32px);
        width: calc(100vw - 32px);
        max-height: 92vh;
        min-height: unset;
        border-radius: 16px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .settings-modal-container {
        max-height: 92vh;
        min-height: unset;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* All pages on mobile - use relative positioning for proper height calculation */
    .settings-page {
        position: relative !important;
        height: auto !important;
        max-height: none !important;
        transform: none !important;
        overflow: visible !important;
    }
    
    /* Hide inactive pages with display instead of position */
    .settings-page:not(.active) {
        display: none !important;
    }
    
    /* Ensure active page is visible */
    .settings-page.active {
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        display: block !important;
    }
    
    .settings-header {
        padding: 12px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(180deg, #1f1f1f 0%, #1a1a1a 100%);
    }
    
    .settings-header h2 {
        font-size: 16px;
    }
    
    .settings-nav {
        padding: 8px 0 16px 0;
    }
    
    .settings-nav-item {
        padding: 10px 12px;
        margin: 3px 8px;
    }
    
    .settings-nav-item .nav-icon {
        width: 36px;
        height: 36px;
    }
    
    .settings-nav-item .nav-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .settings-nav-item .nav-title {
        font-size: 14px;
    }
    
    .settings-nav-item .nav-arrow {
        font-size: 16px;
    }
    
    .settings-nav-item .nav-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .settings-content {
        padding: 12px;
        padding-bottom: 20px;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }
    
    .settings-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .settings-item .item-label {
        font-size: 14px;
    }
    
    .settings-item .item-description {
        font-size: 11px;
    }
    
    .settings-select {
        min-width: 120px;
        max-width: 160px;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .settings-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Source control mobile adjustments */
    .source-type-selector {
        gap: 6px;
    }
    
    .source-type-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .source-options-container {
        padding: 10px;
        overflow: visible;
        max-height: none;
    }
    
    .source-options {
        overflow: visible;
        max-height: none;
    }
    
    .source-checkbox {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .source-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .source-save-btn {
        margin-top: 12px;
        padding: 10px 16px;
    }
}

/* Legacy sidenav - kept for reference but not used */
.sidenav {
    display: none !important;
}

.cachebtn {
    width: auto;
    font-size: 14px;
    padding: 10px 16px;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cachebtn:hover {
    background: #a3001b;
    border-color: #a3001b;
    color: #fff;
}

#main {
    transition: margin-right .5s;
    padding: 16px;
    position: absolute;
    z-index: 999;
    right: 0;
    top: 0;
}

.header-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#main button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    line-height: 0;
}

#main img {
    opacity: 0.5;
    display: block;
    margin: 0;
}

#main img:hover {
    opacity: 1;
}

/* Icon buttons (theme toggle & share) */
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
}

.icon-btn svg {
    color: #fff;
}

.icon-btn .sun-icon {
    display: none;
}

.icon-btn .moon-icon {
    display: block;
}

/* Dark theme - show sun icon, hide moon icon */
[data-theme="dark"] .icon-btn .sun-icon {
    display: block;
}

[data-theme="dark"] .icon-btn .moon-icon {
    display: none;
}

[data-theme="dark"] .icon-btn {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Menu Action Button (Theme & Share in sidenav) */
.menu-action-btn {
    width: 50%;
    height: 34px;
    background: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    padding: 0;
}

.menu-action-btn:hover {
    background: #555;
}

.menu-action-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.menu-action-btn .sun-icon {
    display: none;
}

.menu-action-btn .moon-icon {
    display: block;
}

/* Dark theme - show sun icon, hide moon icon */
[data-theme="dark"] .menu-action-btn .sun-icon {
    display: block;
}

[data-theme="dark"] .menu-action-btn .moon-icon {
    display: none;
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 9997;
    display: none;
    max-width: 300px;
    width: 90%;
    text-align: center;
}

.install-prompt.show {
    display: block;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.install-prompt h4 {
    margin: 0 0 8px 0;
    color: #a3001b;
}

.install-prompt p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #ccc;
}

.install-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.install-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    width: auto;
}

.install-btn.accept {
    background: #a3001b;
    color: #fff;
}

.install-btn.accept:hover {
    background: #c41f37;
}

.install-btn.dismiss {
    background: #333;
    color: #fff;
}

.install-btn.dismiss:hover {
    background: #444;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2a2a2a;
    --border-color: #444;
}

[data-theme="dark"] body {
    background-image: none;
    background-color: #1a1a1a;
}

[data-theme="dark"] .bodyCon08 .students {
    background-color: rgba(26, 26, 26, 0.9);
}

[data-theme="dark"] #four_flash .flashBg ul.mobile li dd {
    border-bottom-color: #444;
}

[data-theme="dark"] #four_flash .flashBg ul.mobile li img {
    border-color: #444;
}

[data-theme="dark"] .sidenav {
    background-color: #0a0a0a;
}

[data-theme="dark"] .reveal-modal,
[data-theme="dark"] .log-modal,
[data-theme="dark"] .source-modal {
    background: #2a2a2a;
}

[data-theme="dark"] .keyboard-modal {
    background: #2a2a2a;
}

[data-theme="dark"] .install-prompt {
    background: #2a2a2a;
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .share-btn {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Age Confirmation Modal */
.age-confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    color: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    max-width: 400px;
    width: 90%;
    display: none;
}

.age-confirm-modal.show {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

.age-confirm-content {
    text-align: center;
}

.age-confirm-icon {
    color: #ff6b6b;
    margin-bottom: 20px;
}

.age-confirm-modal h3 {
    margin: 0 0 16px 0;
    font-size: 24px;
    color: #a3001b;
}

.age-confirm-message {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 12px;
    line-height: 1.5;
}

.age-confirm-question {
    font-size: 18px;
    color: #fff;
    margin-bottom: 24px;
    font-weight: 500;
}

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

.age-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: auto;
    min-width: 120px;
}

.age-btn:hover {
    transform: translateY(-2px);
}

.age-btn-yes {
    background: #a3001b;
    color: #fff;
}

.age-btn-yes:hover {
    background: #c41f37;
}

.age-btn-no {
    background: #333;
    color: #fff;
}

.age-btn-no:hover {
    background: #444;
}

/* Dark theme for age modal */
[data-theme="dark"] .age-confirm-modal {
    background: #2a2a2a;
}


/* Responsive Layout Optimization */

/* Large screens - 4 columns (default) */
/* Already set in main styles: width: 25% */

/* Medium-large screens - 3 columns */
@media screen and (max-width: 1200px) {
    #four_flash .flashBg ul.mobile li {
        width: 33.33%;
    }
    
    #four_flash .flashBg ul.mobile li img {
        width: 120px;
        height: 120px;
        border-width: 8px;
    }
    
    #four_flash .flashBg ul.mobile li dd {
        font-size: 18px;
        width: 200px;
    }
    
    #four_flash .flashBg ul.mobile li p {
        font-size: 14px;
        width: 200px;
    }
}

/* Tablet screens - 2 columns */
@media screen and (max-width: 768px) {
    .bodyCon08 .students {
        width: 100vw !important;
        height: auto;
        min-height: 100vh;
        display: block;
        padding: 20px 0;
    }
    
    #four_flash {
        width: 100vw !important;
    }
    
    #four_flash .flashBg {
        display: block;
        width: 100%;
    }
    
    #four_flash .flashBg ul.mobile {
        height: auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0;
    }
    
    #four_flash .flashBg ul.mobile li {
        width: 50%;
        margin-left: 0;
        opacity: 0.9;
        padding-top: 20px;
        padding-bottom: 20px;
        float: none;
        height: auto;
    }
    
    #four_flash .flashBg ul.mobile li img {
        width: 100px;
        height: 100px;
        border-width: 6px;
        border-radius: 60px;
    }
    
    #four_flash .flashBg ul.mobile li dd {
        font-size: 16px;
        width: 100%;
        max-width: 180px;
        line-height: 50px;
        margin: 0 auto;
    }
    
    #four_flash .flashBg ul.mobile li p {
        font-size: 13px;
        width: 100%;
        max-width: 180px;
        margin: 5px auto 0;
    }
    
    /* Switch css style for tablet */
    .switch {
        width: 50px;
        height: 20px;
    }
    
    .cachebtn {
        font-size: 1em;
    }
    
    .slider:before {
        height: 15px;
        width: 15px;
        bottom: 3px;
    }
    
    /* Sidenav for tablet */
    .sidenav {
        padding-top: 15px;
        width: 280px;
    }
    
    .sidenav div {
        font-size: 18px;
    }
    
    .sidenav span {
        float: left
    }
    
    .sidenav h3 {
        font-size: 24px;
        padding-bottom: 8px;
    }
    
    .install-prompt {
        bottom: 60px;
        max-width: 280px;
        padding: 15px;
    }
}

/* Mobile screens - 1 column */
@media screen and (max-width: 576px) {
    #four_flash .flashBg ul.mobile li {
        width: 100%;
        padding-top: 30px;
        padding-bottom: 30px;
    }
    
    #four_flash .flashBg ul.mobile li img {
        width: 90px;
        height: 90px;
        border-width: 5px;
        border-radius: 50px;
    }
    
    #four_flash .flashBg ul.mobile li dd {
        font-size: 16px;
        line-height: 45px;
    }
    
    #four_flash .flashBg ul.mobile li p {
        font-size: 12px;
    }
    
    /* Smaller buttons on mobile */
    button.stylebtn {
        font-size: 1.2rem;
        padding: 8px 16px;
    }
    
    /* Sidenav for mobile */
    .sidenav {
        width: 250px;
    }
    
    .sidenav div {
        font-size: 16px;
    }
    
    .sidenav h3 {
        font-size: 20px;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    #four_flash .flashBg ul.mobile li img {
        width: 70px;
        height: 70px;
        border-width: 4px;
    }
    
    #four_flash .flashBg ul.mobile li dd {
        font-size: 14px;
        line-height: 40px;
    }
    
    #four_flash .flashBg ul.mobile li p {
        font-size: 11px;
    }
}

/* Dropdown Menu Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 8px 0;
    margin-top: 5px;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1a1a1a;
}

.dropdown-container:hover .dropdown-menu,
.dropdown-container:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #a3001b;
    color: #fff;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Dark theme dropdown */
[data-theme="dark"] .dropdown-menu {
    background: #2a2a2a;
}

[data-theme="dark"] .dropdown-menu::before {
    border-bottom-color: #2a2a2a;
}

/* Mobile dropdown adjustments */
@media screen and (max-width: 768px) {
    .dropdown-menu {
        min-width: 120px;
    }
    
    .dropdown-item {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media screen and (max-width: 576px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 200px;
    }
    
    .dropdown-menu::before {
        display: none;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        text-align: center;
    }
}

/* Source Control Page Styles */
.source-control-section {
    padding: 0;
}

.source-section-title {
    color: #fff;
    font-size: 14px;
    margin: 0 0 12px 0;
    font-weight: 500;
}

.source-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.source-type-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
}

.source-type-btn:hover {
    background: #444;
    border-color: #666;
}

.source-type-btn.active {
    background: #a3001b;
    border-color: #a3001b;
}

.source-options-container {
    background: #222;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.source-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-options.hidden {
    display: none;
}

.source-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 0;
}

.source-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #a3001b;
}

.source-save-btn {
    width: 100%;
    margin-top: 8px;
}

/* Dark theme for source control */
[data-theme="dark"] .source-options-container {
    background: #333;
}

[data-theme="dark"] .source-type-btn {
    background: #444;
    border-color: #666;
}

[data-theme="dark"] .source-type-btn:hover {
    background: #555;
}
