/* public/css/home.css */

.home-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Thanh ngang trên cùng (Header) */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 12px;
    background: var(--bubble-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--bubble-border);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.global-top-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    font-size: var(--header-font-size, 16px);
}

.global-top-header.hide-up {
    transform: translate(-50%, calc(-100% - 90px));
    opacity: 0;
    pointer-events: none;
}

/* Nút Đăng nhập cố định bên dưới Header ở Trang chủ */
.header-bottom-auth-btn {
    position: absolute;
    top: calc(100% + 22px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .header-bottom-auth-btn {
        top: calc(100% + 18px);
    }
}

/* Khoảng cách bù cho trang chủ khi có nút Đăng nhập cố định */
.home-guest-spacer {
    height: 55px;
    width: 100%;
}

@media (max-width: 768px) {
    .home-guest-spacer {
        height: 65px;
    }
}

body.dark-mode .top-header {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Khu vực Logo */
.logo-container {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.6em;
    font-weight: 900;
    margin: 0;
    line-height: 1.1;
    position: relative;
    display: inline-block;
    white-space: nowrap;
    max-width: 100%;
    
    /* Gradient màu đẹp mắt */
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #ec4899, #0ea5e9);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* Hiệu ứng gradient chuyển động nhẹ (Tùy chọn) */
    animation: gradientText 5s linear infinite;
}

@keyframes gradientText {
    to { background-position: 200% center; }
}

/* 3 thanh gạch ngang Hamburger - Hiệu ứng chuyển động màu đồng bộ với chữ brand-name */
.hamburger-bar {
    height: 2px;
    width: 100%;
    border-radius: 1px;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #ec4899, #0ea5e9);
    background-size: 200% auto;
    animation: gradientText 5s linear infinite;
}



/* Chữ nhỏ bên dưới (Phong cách Thẻ Badge hiện đại) */
.brand-slogan {
    font-size: 0.75em;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: 0px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 30px;
    
    /* Màu nền mờ và viền lấy cảm hứng từ tone màu tím của logo */
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
    
    /* Hiệu ứng nhịp thở nhẹ nhàng ở viền và đổ bóng */
    animation: badgePulse 3s ease-in-out infinite alternate;
}

body.dark-mode .brand-slogan {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.3);
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.0);
        border-color: rgba(139, 92, 246, 0.2);
    }
    100% {
        box-shadow: 0 0 12px 0px rgba(139, 92, 246, 0.3);
        border-color: rgba(139, 92, 246, 0.6);
    }
}

    /* Dropdown CSS cho Slogan & Header Control Row */
:root {
    --header-slogan-h: 32px;
}

.slogan-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    align-self: flex-start;
    margin-top: 0;
    height: var(--header-slogan-h, 32px);
    box-sizing: border-box;
}

.slogan-dropdown-container .brand-slogan:not(.btn-calendar-trigger) {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: var(--header-slogan-h, 32px);
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0 10px;
    box-sizing: border-box;
}

.slogan-dropdown-container .btn-calendar-trigger {
    flex: 0 0 var(--header-slogan-h, 32px);
    width: var(--header-slogan-h, 32px);
    height: var(--header-slogan-h, 32px);
    min-width: var(--header-slogan-h, 32px);
    min-height: var(--header-slogan-h, 32px);
    max-width: var(--header-slogan-h, 32px);
    max-height: var(--header-slogan-h, 32px);
    padding: 0;
    margin: 0;
    aspect-ratio: 1 / 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50% !important;
    flex-shrink: 0;
    box-sizing: border-box;
}

.brand-slogan {
    cursor: pointer;
    border: 1px solid rgba(139, 92, 246, 0.4);
    outline: none;
    transition: all 0.2s;
    overflow: hidden;
    white-space: nowrap;
}

.brand-slogan:hover {
    background: rgba(139, 92, 246, 0.2);
}

/* Slot Machine Animation cho Slogan */
.slogan-slot {
    height: 1.5em;
    overflow: hidden;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
}

.slogan-slot .slot-item {
    white-space: nowrap;
}

.slogan-track {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.slogan-track span {
    height: 1.5em;
    line-height: 1.5em;
    display: block;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.slogan-separator {
    margin: 0 4px;
    color: rgba(139, 92, 246, 0.6);
    flex-shrink: 0;
}

/* Dynamic animations are now generated in the blade file to support variable lengths */

.slogan-dropdown-menu {
    position: fixed;
    top: calc(100% + 12px);
    left: 0;
    width: 420px;
    background: var(--popup-bg);
    border: 1px solid var(--popup-border);
    border-radius: 18px;
    box-shadow: var(--popup-glow);
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy effect */
    z-index: 1600;
    font-size: var(--header-font-size, 16px);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.slogan-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Riêng popup chọn chức năng và popup đăng ký ở header: Co giãn font động (Desktop xuất hiện gần select) */
#sloganDropdown,
#roleRegisterPopup {
    position: fixed;
    top: calc(100% + 12px);
    left: 0;
    transform: translateY(-15px);
    margin: 0;
    width: min(calc(100vw - 20px), 440px);
    max-width: 440px;
    max-height: 85vh;
    padding: var(--general-py, 16px) var(--general-px, 14px);
    font-size: var(--slogan-font-size, 18px);
    z-index: 1600;
}

#sloganDropdown.active,
#roleRegisterPopup.active {
    transform: translateY(0);
}

#sloganDropdown h3,
#roleRegisterPopup h3 {
    font-size: clamp(18px, calc(var(--slogan-font-size, 18px) * 1.25), 23px) !important;
    font-weight: 800;
    white-space: nowrap;
}

#sloganDropdown .dropdown-cols,
#roleRegisterPopup .dropdown-cols {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
}

#sloganDropdown .dropdown-col:first-child,
#roleRegisterPopup .dropdown-col:first-child {
    flex: 1.15;
    min-width: 0;
}

#sloganDropdown .dropdown-col:last-child,
#roleRegisterPopup .dropdown-col:last-child {
    flex: 1;
    min-width: 0;
}

#sloganDropdown .dropdown-col-title,
#roleRegisterPopup .dropdown-col-title {
    font-size: clamp(12px, calc(var(--slogan-font-size, 18px) * 0.86), 15.5px);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#sloganDropdown .dropdown-item,
#roleRegisterPopup .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    font-size: clamp(14px, calc(var(--slogan-font-size, 18px) * 1.02), 19.2px);
    font-weight: 500;
    color: var(--text-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

#sloganDropdown .item-text,
#roleRegisterPopup .item-text {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip;
}

#sloganDropdown .custom-radio,
#roleRegisterPopup .custom-radio {
    width: clamp(15px, calc(var(--slogan-font-size, 18px) * 0.95), 18px);
    height: clamp(15px, calc(var(--slogan-font-size, 18px) * 0.95), 18px);
    border-radius: 50%;
    flex-shrink: 0;
}

#sloganDropdown .btn-secondary,
#sloganDropdown .btn-confirm {
    font-size: clamp(13px, calc(var(--slogan-font-size, 18px) * 0.92), 16.5px);
    padding: 7px 16px;
    white-space: nowrap;
}

.dropdown-cols {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
}

.dropdown-cols::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.item-text {
    white-space: nowrap;
}

.dropdown-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 4 Trạng thái Chức năng & Ngành hàng:
   1. Chưa đăng ký: Chữ màu xám
   2. Đăng ký rồi: Chữ màu xanh lá đậm
   3. Đang chờ xét duyệt: Chữ màu cam
   4. Huỷ xét duyệt / từ chối: Chữ màu đỏ */
.role-status-unregistered .item-text {
    color: #8c96a3 !important;
    font-weight: 500 !important;
}
body.dark-mode .role-status-unregistered .item-text {
    color: #9ca3af !important;
}

.role-status-approved .item-text {
    color: #15803d !important;
    font-weight: 700 !important;
}
body.dark-mode .role-status-approved .item-text {
    color: #22c55e !important;
}

.role-status-pending .item-text {
    color: #ea580c !important;
    font-weight: 700 !important;
}
body.dark-mode .role-status-pending .item-text {
    color: #fb923c !important;
}

.role-status-rejected .item-text {
    color: #dc2626 !important;
    font-weight: 700 !important;
}
body.dark-mode .role-status-rejected .item-text {
    color: #ef4444 !important;
}

.dropdown-divider-vertical {
    width: 1px;
    background: var(--bubble-border);
    margin: 0;
}

.dropdown-col-title {
    font-size: 0.8em;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-color);
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.dropdown-item:hover {
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-color);
}

body.dark-mode .dropdown-item:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #f8fafc;
}

.dropdown-item input[type="radio"] {
    display: none;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-muted, #9ca3af);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8b5cf6;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropdown-item input[type="radio"]:checked ~ .custom-radio {
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.dropdown-item input[type="radio"]:checked ~ .custom-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.dropdown-item input[type="radio"]:checked ~ .item-text {
    color: #8b5cf6;
    font-weight: 700;
}

body.dark-mode .dropdown-item input[type="radio"]:checked ~ .item-text {
    color: #a78bfa;
}

.dropdown-item:has(input[type="radio"]:checked) {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

body.dark-mode .dropdown-item:has(input[type="radio"]:checked) {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
}

.dropdown-footer {
    border-top: 1px solid var(--bubble-border);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--btn-border);
    padding: 9px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-secondary:hover {
    background: transparent;
    opacity: 1;
    color: #334155;
    border-color: rgba(168, 85, 247, 0.3) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4), 0 0 12px rgba(6, 182, 212, 0.4);
}

body.dark-mode .btn-secondary:hover {
    background: transparent;
    color: var(--text-color);
    border-color: rgba(168, 85, 247, 0.4) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6), 0 0 12px rgba(6, 182, 212, 0.6);
}

.btn-key-role {
    border: 1px solid var(--btn-border) !important;
    transition: all 0.3s ease !important;
}

.btn-key-role:hover {
    background: var(--popup-bg) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5), 0 0 12px rgba(6, 182, 212, 0.5) !important;
}

@property --border-angle {
    syntax: "<angle>";
    initial-value: 0turn;
    inherits: false;
}

.btn-confirm, .btn.btn-primary {
    background: linear-gradient(#f1f5f9, #f1f5f9) padding-box, 
                conic-gradient(from var(--border-angle), #a855f7, #06b6d4, #a855f7, #06b6d4, #a855f7) border-box;
    animation: borderSpin 3s linear infinite;
    color: #0f172a;
    border: 2px solid transparent;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .btn-confirm, body.dark-mode .btn.btn-primary {
    background: linear-gradient(#0f172a, #0f172a) padding-box, 
                conic-gradient(from var(--border-angle), #a855f7, #06b6d4, #a855f7, #06b6d4, #a855f7) border-box;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes borderSpin {
    to { --border-angle: 1turn; }
}



.btn-confirm span, .btn.btn-primary span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-confirm:hover, .btn.btn-primary:hover {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3), 0 0 12px rgba(6, 182, 212, 0.3);
    color: #0f172a;
}

body.dark-mode .btn-confirm:hover, body.dark-mode .btn.btn-primary:hover {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6), 0 0 12px rgba(6, 182, 212, 0.6);
    color: white;
}

/* Responsive - Hỗ trợ thiết bị nhỏ */
@media (max-width: 768px) {
    .global-top-header {
        top: 10px;
        width: calc(100% - 20px);
    }

    .top-header {
        padding: 12px 14px;
        border-radius: 16px;
    }
    
    .brand-name {
        font-size: 1.55em;
        white-space: nowrap;
    }
    
    .brand-slogan {
        font-size: 0.7em;
    }
    
    .slogan-dropdown-menu {
        width: min(calc(100vw - 20px), 420px);
        max-width: 420px;
        left: -15px; /* Căn sát lề trái của header để không bị tràn phải */
        padding: 15px 12px;
    }

    .dropdown-cols {
        gap: 6px;
    }

    .dropdown-item {
        padding: 8px;
        gap: 8px;
        font-size: 0.95em;
        padding-right: 0px;
    }

    .custom-radio {
        width: 16px;
        height: 16px;
    }
    
    .custom-radio::after {
        width: 8px;
        height: 8px;
    }
    
    .btn-confirm i, .btn.btn-primary i {
        display: none;
    }
}

@media (max-width: 576px) {
    .top-header {
        padding: 12px 10px;
    }
    
    .brand-name {
        font-size: 1.5em;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .top-header {
        padding: 10px 8px;
    }
    
    .brand-name {
        font-size: 1.45em;
        white-space: nowrap;
    }
}

/* Styles cho Admin Roles Popup */
.admin-role-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.admin-role-item:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
}

body.dark-mode .admin-role-item:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

.admin-role-item.super-admin {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.admin-role-item.super-admin:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

.admin-role-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(127,127,127,0.1);
    font-size: 0.85em;
}

.admin-role-item.super-admin .admin-role-icon {
    background: rgba(59, 130, 246, 0.1);
}

/* Tự động căn giữa Popup trên điện thoại để không bị tràn màn hình */
@media (max-width: 576px) {
    .slogan-dropdown-menu {
        position: fixed;
        top: 95px;
        left: 50%;
        transform: translateX(-50%) translateY(-15px);
        width: min(calc(100vw - 20px), 420px);
        max-width: 420px;
        max-height: calc(100vh - 110px);
        padding: 15px 8px !important;
    }
    
    .slogan-dropdown-menu.active {
        transform: translateX(-50%) translateY(0);
    }

    /* Riêng popup chọn chức năng ở header: Giữ căn chính giữa màn hình & thích ứng mobile */
    #sloganDropdown {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95) !important;
        width: min(calc(100vw - 20px), 440px) !important;
        max-width: 440px !important;
        max-height: 85vh;
        padding: var(--general-py, 14px) var(--general-px, 8px) !important;
        font-size: var(--slogan-font-size, 18px);
    }

    #sloganDropdown.active {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    #sloganDropdown .dropdown-cols {
        gap: 6px;
    }

    #sloganDropdown .dropdown-item {
        padding: 5px 3px !important;
        gap: 6px !important;
        font-size: clamp(13px, calc(var(--slogan-font-size, 18px) * 0.98), 18.5px) !important;
    }

    #sloganDropdown .custom-radio {
        width: clamp(14px, calc(var(--slogan-font-size, 18px) * 0.94), 17px) !important;
        height: clamp(14px, calc(var(--slogan-font-size, 18px) * 0.94), 17px) !important;
    }

    .dropdown-cols {
        gap: 4px;
    }
    
    .dropdown-item {
        padding: 6px 4px;
        gap: 6px;
        font-size: 0.85em;
    }
    
    .custom-radio {
        width: 14px;
        height: 14px;
    }
}

/* NÚT ĐÓNG POPUP (Chuẩn chung) */
.btn-close-popup { width: 32px; height: 32px; min-width: 32px; min-height: 32px; flex-shrink: 0 !important; display: flex; align-items: center; justify-content: center; border-radius: 50% !important; transition: all 0.2s; color: var(--text-muted); background-color: rgba(127,127,127,0.08) !important; border: 1px solid var(--popup-border) !important; padding: 0 !important; cursor: pointer; }
.btn-close-popup:hover { background-color: rgba(239, 68, 68, 0.08) !important; border-color: rgba(239, 68, 68, 0.3) !important; color: #ef4444 !important; box-shadow: 0 0 10px rgba(239, 68, 68, 0.3), 0 0 15px rgba(239, 68, 68, 0.2) !important; transform: scale(1.05); }
body.dark-mode .btn-close-popup:hover { background-color: rgba(239, 68, 68, 0.15) !important; border-color: rgba(239, 68, 68, 0.5) !important; color: #f87171 !important; box-shadow: 0 0 12px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3) !important; }

/* DYNAMIC UTILITIES FOR ARCHITECTURE SCALING */
.dynamic-mb {
    margin-bottom: var(--settings-gap, 20px) !important;
}

@media (max-width: 576px) {
    :root {
        --general-px: 12px !important;
        --general-py: 12px !important;
        --settings-gap: 12px !important;
    }
    .edit-personal-backdrop, .add-account-backdrop, .edit-role-backdrop, .edit-login-backdrop {
        padding: 10px !important;
    }
}

/* CLOCK POPUP DISPLAY (RESPONSIVE DIGITAL 7 SEGMENT) */
@keyframes clockColonBlink {
    50% { opacity: 0; }
}

.system-time-display {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 15px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 18px;
    border: 1px solid var(--bubble-border);
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    position: relative;
    box-sizing: border-box;
    white-space: nowrap;
    flex-shrink: 0;
}

body.dark-mode .system-time-display {
    background: rgba(255, 255, 255, 0.03);
}

.clock-digits-group {
    font-family: 'Digital7', monospace;
    font-size: clamp(40px, 11.5vw, 54px);
    color: var(--text-color);
    line-height: 1;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-end;
    white-space: nowrap;
    flex-shrink: 0;
}

.clock-digits-group span {
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}

.clock-colon {
    animation: clockColonBlink 1s step-end infinite;
    margin: 0 4px;
    position: relative;
    top: -2px;
}

.clock-seconds-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 10px;
    height: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.clock-ampm-btn {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    cursor: pointer;
    color: var(--primary-color);
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
    user-select: none;
    margin-top: -4px;
    white-space: nowrap;
}

.clock-ampm-btn:hover {
    background: rgba(14, 165, 233, 0.2);
}

.clock-secs-text {
    font-family: 'Digital7', monospace;
    font-size: clamp(18px, 5.2vw, 24px);
    color: var(--text-color);
    line-height: 1;
    opacity: 0.85;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 0px;
    white-space: nowrap;
}

@media (max-width: 360px) {
    .system-time-display {
        padding: 10px 12px;
    }
    .clock-digits-group {
        font-size: 38px;
        letter-spacing: 1.5px;
    }
    .clock-colon {
        margin: 0 3px;
    }
    .clock-seconds-group {
        margin-left: 8px;
    }
    .clock-secs-text {
        font-size: 18px;
    }
}


