@font-face {
    font-family: BRegular;
    src: url('../fonts/BaiJamjuree-Regular.ttf') format('truetype');
}
@font-face {
    font-family: BMedium;
    src: url('../fonts/BaiJamjuree-Medium.ttf') format('truetype');
}
@font-face {
    font-family: BBold;
    src: url('../fonts/BaiJamjuree-Bold.ttf') format('truetype');
}
@font-face {
    font-family: 'Di7';
    src: url('../fonts/digital-7.ttf'); /* đường dẫn đến file font */
}
@font-face {
    font-family: 'Di7Mono';
    src: url('../fonts/Digital7Mono.ttf'); /* đường dẫn đến file font */
}
@font-face {
    font-family: BSemiBold;
    src: url('../fonts/BaiJamjuree-SemiBold.ttf') format('truetype');
}
@font-face {
    font-family: RBold;
    src: url('../fonts/Roboto-Bold.ttf') format('truetype');
}
@font-face {
    font-family: RMedium;
    src: url('../fonts/Roboto-Medium.ttf') format('truetype');
}
@font-face {
    font-family: RRegular;
    src: url('../fonts/Roboto-Regular.ttf') format('truetype');
}
:root {
    --primary-color: #027353;
    --text-color: #fff;
    --hover-color: #ffff00;
    --bg-color: #f9f9f9;
    --footer-bg: #222;
    --footer-text: #ddd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    *font-family: 'Segoe UI', sans-serif;
    font-family:BRegular;
    background-color: var(--bg-color);
    color: #333;
}
.pas{padding:5px}
.pam{padding:10px}
.pal{padding:20px}
.pts{padding-top:5px}
.ptm{padding-top:10px !important;}
.pt5{padding-top:50px}
.ptl{padding-top:20px}
.prs{padding-right:5px}
.prm{padding-right:10px}
.prl{padding-right:20px}
.pbs{padding-bottom:5px}
.pbm{padding-bottom:10px}
.pbl{padding-bottom:20px}
.pls{padding-left:5px}
.plm{padding-left:10px}
.pll{padding-left:20px}
.phs{padding-left:5px;padding-right:5px}
.phm{padding-left:10px;padding-right:10px}
.phl{padding-left:20px;padding-right:20px}
.pvs{padding-top:5px;padding-bottom:5px}
.pvm{padding-top:10px;padding-bottom:10px}
.pvl{padding-top:20px;padding-bottom:20px}
.mas{margin:5px}
.mam{margin:10px}
.mal{margin:20px}
.mts{margin-top:5px}
.mtm{margin-top:10px}
.mt15{margin-top:15px}
.mt30{margin-top:30px}
.mtl{margin-top:20px !important}
.mrs{margin-right:5px}
.mrm{margin-right:10px}
.mrl{margin-right:20px}
.mbs{margin-bottom:5px}
.mbm{margin-bottom:10px}
.mb15{margin-bottom:15px}
.mb30{margin-bottom:30px}
.mbl{margin-bottom:20px}
.mls{margin-left:5px}
.mlm{margin-left:10px}
.mll{margin-left:20px}
.mhs{margin-left:5px;margin-right:5px}
.mhm{margin-left:10px;margin-right:10px}
.mhl{margin-left:20px;margin-right:20px}
.mvs{margin-top:5px;margin-bottom:5px}
.mvm{margin-top:10px;margin-bottom:10px}
.mvl{margin-top:20px;margin-bottom:20px}
.fss{font-size:9px}
.fsm{font-size:11px}
.fsl{font-size:13px}
.fsxl{font-size:16px}
.fsxxl{font-size:18px}
.fwn{font-weight:normal}
.fwb{font-family:RBold}
.fca{color:#DD4B39}
.fcb{color:#333}
.fcg{color:gray}
.fcw{color:White}
.bcw{background-color:#fff}
.fcgb{color:#414B56}
.w1{width:100px}
.w2{width:200px}
.w3{width:300px}
.w4{width:400px}
.w5{width:500px}
.w6{width:600px}
.w7{width:700px}
.w8{width:800px}
.w9{width:900px}
.w12{width:120px}
.w15{width:150px}
.w25{width:250px}
.w35{width:350px}
.w45{width:450px}
.w55{width:550px}
.w65{width:650px}
.w75{width:750px}
.h10{height:10px}
.h20{height:20px}
.h30{height:30px}
.h40{height:40px}
.h50{height:50px}
.h60{height:60px}
.h70{height:70px}
.h80{height:80px}
.h90{height:90px}
.h100{height:100px}
.h200{height:200px}
.h300{height:300px}
.h150{height:150px}
.h250{height:250px}
.h350{height:350px}
.br1{border-radius:1px !important;}
.br2{border-radius:2px !important;}
.br3{border-radius:3px !important;}
.br4{border-radius:4px !important;}
.br5{border-radius:5px !important;}
.br6{border-radius:6px !important;}
.br7{border-radius:7px !important;}
.br8{border-radius:8px !important;}
.br9{border-radius:9px !important;}
.br10{border-radius:10px !important;}
h2, h3, h4, b, strong{
    font-family: BBold;
}
h2, h3, h4, b, strong{
    font-weight: normal;
}
.s-logo a {
    color: #FFFFCC !important;
    display: block;
    line-height: 35px;
    font-family: BBold;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 20px;
    font-weight: normal;
    text-shadow: 1px 1px 1px #002200, 0 0 25px #01936a, 0 0 1px darkgreen;
}
.s-logo ._sss {
    font-size: 14px;
    text-transform: lowercase;
    text-shadow: none;
    font-family: 'BRegular';
}

body.menu-open {
    overflow: hidden;
}

header {
    background-color: var(--primary-color);
    height: 45px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
h1{
    font-size: 28px;
    color: #000;
    text-transform: uppercase;
    font-weight: normal;
    font-family: BBold;
}

.menu-container {
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    flex: 1;
    justify-content: flex-end;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    flex-shrink: 0;
}

nav a:hover {
    color: var(--hover-color);
}

nav a.active {
    text-decoration: underline;
    text-underline-position:under;
    color: var(--hover-color);
    font-family: BBold;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 14px;
    cursor: pointer;
    position: absolute;
    right: 0.5rem;
    z-index: 1100;
}

.menu-toggle div {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
}

.menu-toggle div:nth-child(1) { top: 0; }
.menu-toggle div:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle div:nth-child(3) { bottom: 0; }

.menu-toggle.active div:nth-child(1) {
    top: 40%;
    transform: rotate(45deg);
}
.menu-toggle.active div:nth-child(2) { opacity: 0; }
.menu-toggle.active div:nth-child(3) {
    bottom: 40%;
    transform: rotate(-45deg);
}

.theme-toggle {
    color: var(--text-color);
    cursor: pointer;
    font-size: 18px;
    margin-left: 1rem;
    transition: transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

.more-toggle {
    width: 22px;
    height: 14px;
    cursor: pointer;
    margin-left: 1rem;
    position: relative;
    z-index: 1001;
    display: none;
}

.more-toggle div {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.more-toggle div:nth-child(1) { top: 0; }
.more-toggle div:nth-child(2) { top: 50%; transform: translateY(-50%); }
.more-toggle div:nth-child(3) { bottom: 0; }

.more-toggle.active div:nth-child(1) {
    top: 40%;
    transform: rotate(45deg);
}
.more-toggle.active div:nth-child(2) { opacity: 0; }
.more-toggle.active div:nth-child(3) {
    bottom: 40%;
    transform: rotate(-45deg);
}

.more-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--primary-color);
    color: var(--text-color);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.more-popup.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.more-popup nav {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.main-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0 0 2rem 0;
}

.main-wrapper .side {
    flex: 1;
    background: transparent; /* có thể dùng màu test nếu cần */
}

.main-wrapper .main-content {
    width: 1024px;
    max-width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

span.flatpickr-weekday{
    background: #f6f6f6;
    color: #333;
    padding: 7px 0;
}

#tab-menu {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    gap: 10px;
    scrollbar-width: none;
}

#tab-menu::-webkit-scrollbar {
    display: none;
}

.tab-button {
    flex: 0 0 auto;
    padding: 12px 18px;
    background: #eee;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #263238;
    color: white;
}

.tab-button i {
    font-size: 16px;
}

.tab-content {
    display: none;
    padding: 20px;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.tab-summary{
    display: none;
}
.tab-summary a, .summary a{
    text-decoration: none;
    *text-underline-position:under;
    color: #08c;
    font-family: BBold;
}

.tab-content.active, .tab-summary.active {
    display: block;
    animation: slideIn 0.4s ease;
    border-top: 1px solid #CCC;
    margin-top: 30px;
}

.tab-content {
    background-repeat: no-repeat;       /* Không lặp ảnh */
    background-size: cover;           /* Hiển thị vừa đủ ảnh */
    background-position: center center; /* Căn giữa ảnh */
    overflow: hidden;                   /* Ẩn phần tràn nếu ảnh quá to */
}


/**
ĐỒNG HỒ*/
svg.clock_kim{
    width: 320px;
    height: 320px;
}

.clock_kim .tick {
    stroke: #333;
    stroke-width: 1;
    stroke-linecap: round;
}

.clock_kim .tick.major {
    stroke-width: 2;
    stroke-linecap: round;
}

.clock_kim .number {
    fill: #000;
    font-size: 16px;
    text-anchor: middle;
    dominant-baseline: central;
}

.clock_kim .hand {
    stroke-linecap: round;
}

.clock_kim .hour-hand {
    stroke: #111;
    stroke-width: 10;
    stroke-linecap: round;
}

.clock_kim .minute-hand {
    stroke: #222;
    stroke-width: 8;
    stroke-linecap: round;
}

.clock_kim .second-hand {
    stroke: red;
    stroke-width: 3;
    stroke-linecap: round;
}

.clock_kim .center-dot {
    fill: #333;
}

.clock_kim .clock-face {
    stroke: #333;
    stroke-width: 3;
    fill: #FFF;
}

/* Đảm bảo input, div không tràn khi cha có padding */
.count-days-form *, .add-date-form *, .subtract-date-form * {
    box-sizing: border-box;
}

/* Tổng thể form */
.count-days-form {
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Giữa các form-control nên có spacing đều */
.count-days-form .form-control {
    margin-bottom: 20px;
}

/* Label */
.count-days-form .label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    margin-bottom: 6px;
}

.count-days-form .label-text {
    font-size: 15px;
}

.count-days-form .label-text-alt, .add-date-form .label-text-alt , .subtract-date-form .label-text-alt {
    font-size: 14px;
    *color: #007BFF;
    color: #28a745;
    cursor: pointer;
    text-decoration: underline;
}

/* Input */
.count-days-form .input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background-color: #f9f9f9;
}

.count-days-form .input:read-only {
    background-color: #f0f0f0;
    *cursor: not-allowed;
}

/* Checkbox */
.count-days-form .checkbox {
    width: 20px;
    height: 20px;
    *accent-color: #007BFF;
    accent-color: #28a745;
    cursor: pointer;
}

/* Button */
.count-days-form .btn, .add-date-form .btn , .subtract-date-form .btn {
    width: 100%;
    *background-color: #007BFF;
    background-color: #D20000;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.count-days-form .btn:hover, .add-date-form .btn:hover , .subtract-date-form .btn:hover {
    *background-color: #0056b3;
    background-color: #A20000;
}

/* Stats Result */
.count-days-form .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
    margin-top: 10px;
    border-radius: 10px;
    background-color: #f3f6f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.count-days-form .stat {
    background-color: #fff;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.count-days-form .stat-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.count-days-form .stat-value {
    font-size: 22px;
    color: #333;
    font-family: BBold;
}

/* Tổng thể form */
.add-date-form, .subtract-date-form {
    padding: 20px;
    background-color: #fefefe;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Form control */
.add-date-form .form-control, .subtract-date-form .form-control {
    margin-bottom: 18px;
}

/* Label */
.add-date-form .label, .subtract-date-form .label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.add-date-form .label-text, .subtract-date-form .label-text {
    font-size: 15px;
    color: #222;
}

/* Input fields */
.add-date-form .input, .subtract-date-form .input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background-color: #f9f9f9;
}

.add-date-form .input:read-only, .subtract-date-form .input:read-only {
    background-color: #f0f0f0;
    *cursor: not-allowed;
}

/* Grid nhóm input số */
.add-date-form .grid, .subtract-date-form .grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(1, 1fr); /* Mặc định mobile: 1 cột */
}
@media (min-width: 640px) {
    /* Tablet trở lên: 2 cột */
    .add-date-form .grid, .subtract-date-form .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    /* Desktop: 4 cột */
    .add-date-form .grid, .subtract-date-form .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Kết quả */
.add-date-form #add-result, .subtract-date-form #subtract-result {
    margin-top: 20px;
}

.add-date-form .alert, .subtract-date-form .alert {
    padding: 16px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
}
strong{
    font-weight: normal;
    font-family: BBold;
}
.add-date-form .font-bold, .subtract-date-form .font-bold {
    color: #0c4b33;
    margin-left: 6px;
    font-family: BBold;
}



/* Tùy chỉnh giao diện Flatpickr */
.flatpickr-calendar {
    border-radius: 8px; /* Góc tròn cho calendar */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Đổ bóng cho calendar */
}

.flatpickr-input {
    cursor: pointer; /* Thêm con trỏ khi hover vào input */
}

#color-picker, #digit-bg-picker, #digit-text-picker, #bg-image-picker{
    margin: 20px 0 15px 0;
}

#color-picker strong, #digit-bg-picker strong, #digit-text-picker strong, #bg-image-picker strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.color-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.color-option {
    width: 40px;
    height: 32px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #ccc;
    box-shadow: 0 0 2px rgba(0,0,0,0.1);
    transition: border-color 0.3s;
}

.color-option:hover {
    border-color: #666;
}

/*Nên clock*/
.color-option[data-color="#ffffff"] { background-color: #ffffff; }
.color-option[data-color="#fff8dc"] { background-color: #fff8dc; }
.color-option[data-color="#d0f0c0"] { background-color: #d0f0c0; }
.color-option[data-color="#d6eaff"] { background-color: #d6eaff; }
.color-option[data-color="#ffe0e9"] { background-color: #ffe0e9; }
.color-option[data-color="#fff1b5"] { background-color: #fff1b5; }
.color-option[data-color="#e6e6fa"] { background-color: #e6e6fa; }
.color-option[data-color="#e0fff4"] { background-color: #e0fff4; }
.color-option[data-color="#ffe5b4"] { background-color: #ffe5b4; }
.color-option[data-color="#f2f2f2"] { background-color: #f2f2f2; }


/* Nền số */
.color-option[data-bg="#000000"] { background-color: #000000; }
.color-option[data-bg="#b71c1c"] { background-color: #b71c1c; }
.color-option[data-bg="#0d47a1"] { background-color: #0d47a1; }
.color-option[data-bg="#4a148c"] { background-color: #4a148c; }
.color-option[data-bg="#1b5e20"] { background-color: #1b5e20; }
.color-option[data-bg="#e65100"] { background-color: #e65100; }
.color-option[data-bg="#4e342e"] { background-color: #4e342e; }
.color-option[data-bg="#263238"] { background-color: #263238; }
.color-option[data-bg="#37474f"] { background-color: #37474f; }
.color-option[data-bg="#33691e"] { background-color: #33691e; }

/* Chữ số */
.color-option[data-text="#ffffff"] { background-color: #ffffff; }
.color-option[data-text="#ffecb3"] { background-color: #ffecb3; }
.color-option[data-text="#c3f8ff"] { background-color: #c3f8ff; }
.color-option[data-text="#ffd6e0"] { background-color: #ffd6e0; }
.color-option[data-text="#d7f5d7"] { background-color: #d7f5d7; }
.color-option[data-text="#d6eaff"] { background-color: #d6eaff; }
.color-option[data-text="#ffe0e9"] { background-color: #ffe0e9; }
.color-option[data-text="#fff1b5"] { background-color: #fff1b5; }
.color-option[data-text="#e6e6fa"] { background-color: #e6e6fa; }
.color-option[data-text="#e0fff4"] { background-color: #e0fff4; }

.color-option.active {
    border: 3px solid #2196f3;
    box-shadow: 0 0 5px #2196f3;
    position: relative;
}

.color-option.active::after {
    content: '✓';
    color: #2196f3;
    position: absolute;
    right: 12px;
    bottom: 3px;
    font-size: 16px;
}
.reset-color {
    margin-top: 10px;
    padding: 6px 10px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.reset-color:hover {
    background-color: #ddd;
}

.bg-image-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.bg-image-option {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    cursor: pointer;
    transition: border 0.3s, transform 0.2s;
}

.bg-image-option:hover {
    transform: scale(1.03);
}

.bg-image-option.active {
    border-color: #007bff;
}
.bg-image-option.active::after {
    content: "✔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    font-size: 24px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border:3px solid #FFF
}
.upload-btn {
    display: inline-block;
    padding: 8px 12px;
    background-color: #DD0000;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 12px;
}

.upload-btn:hover {
    background-color: #CC0000;
}

.upload-note {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}
.uploaded-image-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
}
@media (max-width: 600px) {
    .uploaded-image-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
.uploaded-image-box {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ccc;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition: border 0.3s, transform 0.2s;
}
.uploaded-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cắt phần thừa, giữ tỷ lệ ảnh */
    display: block;
}
.uploaded-image-actions {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.uploaded-image-actions button {
    font-size: 12px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    line-height: 22px;
    width: 50px;
    margin: 0 auto;
}
.uploaded-image-actions button:hover {
    background: rgba(0,0,0,0.7);
}

.uploaded-image-box {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}


.uploaded-image-box.active::after {
    content: "✔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    font-size: 24px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border:3px solid #FFF
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}



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


.share-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-top: 30px;
}

.share-box .share-btn {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.share-box .fb { background: #3b5998; }
.share-box .tw { background: #1da1f2; }
.share-box .zalo { background: #0068ff; }
.share-box .li { background: #0077b5; }
.share-box .tg { background: #229ED9; }

.share-box .share-btn:hover {
    opacity: 0.85;
}

/* Icon style placeholder (replace with real icons or font-icons) */
.share-box .icon {
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.icon-fb { background-image: url('../images/facebook.svg'); }
.icon-tw { background-image: url('../images/x.svg'); }
.icon-zalo { background-image: url('../images/zalo.svg'); }
.icon-li { background-image: url('../images/linkedin.svg'); }
.icon-tg { background-image: url('../images/telegram.svg'); }

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem;
    text-align: center;
}
footer nav {
    justify-content: center;
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: none;
}
footer .txt_logo {
    font-family: BBold;
    text-decoration: none;
    color: #FFF;
}
footer nav a {
    color: var(--footer-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}
footer nav a:hover {
    color: var(--hover-color);
}
.half-circle-icon {
    margin-left: 20px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    border-radius: 50%;
    background: linear-gradient(to right, #027353 50%, white 50%);
    border: 2px solid #FFF; /* Tùy chọn viền */
}

.digit-flip .clock-container {
    max-width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    color: #000;
}

.digit-flip .clock-zoom-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease-in-out;
    transform-origin: center center;
}

.digit-flip .clock-line {
    display: flex;
    *flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.digit-flip .digit-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 90px;
    max-width: 200px;
    font-family: BBold;
}

#so .digit-flip .digit {
    font-family: Di7Mono !important;
    font-size: 125px !important;
}

.digit-flip .digit {
    position: relative;
    width: 100%;
    height: 140px;
    height: 140px;
    overflow: hidden;
    background: #222;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    color: #fff;
    text-align: center;
    font-size: 100px;
    padding: 0 15px;
    text-shadow: 3px 1px 1px #000;
}

#so .digit {
    padding-top: 5px !important;
    background: #ff9900;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
#so .digit::before {
    display: none !important;
}
.digit-flip .digit::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #444;
    transform: translateY(-1px);
    z-index: 5;
}

.digit-flip .label {
    margin-top: 8px;
    font-size: 18px;
    color: #333;
    text-shadow: 1px 1px 1px #FFF;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.digit-flip .digit-inner {
    transition: transform 0.5s ease-in-out;
}

.digit-flip .digit-number {
    height: 140px;
    line-height: 140px;
}

.digit-flip .ampm-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 90px;
    max-width: 120px;
    margin-top: 0;
}

.digit-flip .ampm {
    font-size: 22px;
    color: #fff;
    background: #666;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 54px;
    font-family: BMedium;
    opacity: 0.7;
}

.digit-flip .ampm-label {
    margin-top: 8px;
    font-size: 18px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.digit-flip .date-text {
    font-size: 22px;
    color: #333;
    margin-top: 30px;
    text-align: center;
    text-shadow: 1px 1px 1px #FFF;
}
.digit-flip .date-text {
    padding: 0 50px;
}

.toggle-container {
    margin-top: 30px;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    *justify-content: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    margin-left: 15px;
}

.checkbox-label input {
    display: none;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #888;
    border-radius: 4px;
    position: relative;
    background-color: #fff;
    transition: all 0.2s;
}

.checkbox-label input:checked + .custom-checkbox {
    background-color: #444;
    border-color: #444;
}

.checkbox-label input:checked + .custom-checkbox::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    top: 0px;
    left: 5px;
    transform: rotate(45deg);
}

.digit-flip .checkbox-label input:focus + .custom-checkbox {
    box-shadow: 0 0 0 4px rgba(72, 105, 180, 0.5);
}
.digit-flip{
    position: relative;
}
.w-full{
    position: relative;
}
.w-full .zoom-controls {
    position: absolute;
    top: 95px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.w-full .zoom-controls button {
    background-color: #999;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    opacity: 0.5;
}

.w-full .zoom-controls button:hover:enabled, .w-full #fullscreenBtn:hover {
    opacity: 0.8;
}

.w-full .zoom-controls button:disabled {
    background-color: #aaa;
}

.w-full #fullscreenBtn {
    background-color: #999;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    opacity: 0.5;
}

.digit-flip #fullscreenBtn i {
    color: #fff;
}

.w-full .fullscreen-mode-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000000;
}
.fullscreen-mode {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    overflow: auto !important;
    display: flex !important;
    justify-content: center !important; /* căn giữa theo chiều ngang */
    align-items: center !important;     /* căn giữa theo chiều dọc */
    margin-top: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
}


/* STOPWATCH */
.stopwatch-app {
    position: relative;
}
.fullscreen-toggle {
    position: absolute;
    top: -10px;
    right: 24px;
    z-index: 100;
}

#fullscreen-btn {
    background: #CCC;
    color: white;
    border: none;
    padding: 7px 10px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#fullscreen-btn:hover {
    background: #999;
}
.stopwatch-app .container {
    margin: auto;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: #000;
}
.stopwatch-app .time-display {
    font-family: 'Di7Mono';
    font-feature-settings: 'tnum';
    font-size: 160px;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    background: #f3f3f3;
    padding: 3px 5px;
    border-radius: 5px;
}
.stopwatch-app .time-display #time-main{
    *width: 60%;
}
#lap-time-remaining{
    font-family: RMedium;
    font-size: 24px;
    vertical-align: sub;
    display: block;
    text-align: center;
    margin-bottom: 20px;
    color: #00cc99;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.stopwatch-app .hundredths {
    font-size: 80px;
    vertical-align: bottom;
    display: inline-block;
}
.stopwatch-app .buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.stopwatch-app .button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-family: BMedium;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.stopwatch-app .button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}
.stopwatch-app .button.start{
    background: linear-gradient(135deg, #2196F3, #1976D2);
}
.stopwatch-app .button.continue {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}
.stopwatch-app .button.pause {
    background: linear-gradient(135deg, #E53935, #C62828);
}
.stopwatch-app .button.reset {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}
.stopwatch-app .button.lap {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}
.stopwatch-app .button.clear {
    background: linear-gradient(135deg, #E53935, #C62828);
}
.stopwatch-app .button.hide-s, .stopwatch-app .button.hide-h {
    background: #999;
}
.export-buttons button._exp{
    background: linear-gradient(135deg, #2196F3, #1976D2);
}
.stopwatch-app table, .clockcm table {
    width: 100%;
    border-collapse: collapse;
}
.stopwatch-app th, .stopwatch-app td, .clockcm th, .clockcm td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
    font-weight: normal;
}

.stopwatch-app h3 {
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 40px;
}
.stopwatch-app td, .clockcm td {
    font-family: BRegular;
    color: #666;
}
.stopwatch-app th, .clockcm th {
    background: #f0f0f0;
    font-family: BMedium;
}

.stopwatch-app .export-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}
.stopwatch-app.fullscreen-mode .container {
    max-width: 100%;
    padding: 20px;
    text-align: center;
}

.stopwatch-app.fullscreen-mode h3,
.stopwatch-app.fullscreen-mode table,
.stopwatch-app.fullscreen-mode .export-buttons,
.stopwatch-app.fullscreen-mode .buttons button:not(.start):not(.pause):not(.lap):not(.reset):not(.hide-h):not(.hide-s):not(.continue) {
    display: none !important;
}

.stopwatch-app.fullscreen-mode .time-display {
    justify-content: center;
}

.stopwatch-app.fullscreen-mode .buttons {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}
.no-data{
    font-size: 14px; color: #999;
    text-align:center; font-style:italic;
}
/* STOPWATCH */
.hide{display: none;}


/*dark mode============================================*/
body.dark-mode {
    background-color: #010101;
    color: #eee;
}

body.dark-mode header {
    background-color: #222;
}

body.dark-mode .half-circle-icon {
    background: linear-gradient(to right, #000 50%, white 50%);
}
body.dark-mode .tab-button {
    color: #fff;
    background: #333;
}
body.dark-mode .tab-button.active {
    background: #CCC;
    color: #000;
}
body.dark-mode h1, body.dark-mode nav a, body.dark-mode .count-days-form .label, body.dark-mode .label-text , body.dark-mode .toggle-container {
    color: #ddd;
}

body.dark-mode nav a.active,
body.dark-mode nav a:hover {
    color: #ffff00;
}


body.dark-mode .tab-content,
body.dark-mode .count-days-form,
body.dark-mode .add-date-form,
body.dark-mode .subtract-date-form {
    background-color: #1e1e1e;
    color: #eee;
    border-color: #444;
}

body.dark-mode .input,
body.dark-mode .count-days-form .input:read-only {
    background-color: #2c2c2c !important;
    color: #fff;
    border-color: #555;
}

body.dark-mode .digit-flip .clock-container,
body.dark-mode .digit-flip .clock-line,
/*body.dark-mode .digit-flip .label,
body.dark-mode .digit-flip .ampm-label,
body.dark-mode .digit-flip .date-text,*/
body.dark-mode .digit-flip .toggle-container {
    color: #eee;
}

body.dark-mode #so .digit{
    background: #ffcc00;
}
body.dark-mode .digit-flip .digit {
    background: #ccc;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

body.dark-mode .digit-flip .digit::before {
    background: #999;
}

body.dark-mode .digit-flip .ampm {
    background: #eee;
    color: #222;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark-mode .digit-flip .custom-checkbox {
    background-color: #222;
    border-color: #aaa;
}

body.dark-mode .digit-flip .checkbox-label input:checked + .custom-checkbox {
    background-color: #eee;
    border-color: #eee;
}

body.dark-mode .digit-flip .checkbox-label input:checked + .custom-checkbox::after {
    border-color: #222;
}

body.dark-mode .digit-flip .zoom-controls button,
body.dark-mode .digit-flip #fullscreenBtn {
    background-color: #eee;
    color: #000;
}

body.dark-mode .digit-flip #fullscreenBtn i {
    color: #000;
}

body.dark-mode .digit-flip .fullscreen-mode {
    background: #121212;
    color: #eee;
}

/*ĐỒNG HỒ KIM*/
body.dark-mode .clock_kim .tick {
    stroke: #ccc;
}
body.dark-mode .clock_kim .number {
    dominant-baseline: central;
}
body.dark-mode .clock_kim .second-hand {
    stroke: red;
}

body.dark-mode .stopwatch-app .container .time-display, body.dark-mode .stopwatch-app td, body.dark-mode .stopwatch-app h3{
    color: #FFF;
}
body.dark-mode #fullscreen-btn {
    background: #777;
}
body.dark-mode .stopwatch-app .time-display{
    background: #444;
}
body.dark-mode .stopwatch-app .container{
    background: #333;
}
body.dark-mode .stopwatch-app th{
    background: #444;
    color: #FFF;
}
body.dark-mode .stopwatch-app th, body.dark-mode .stopwatch-app td{
    border: 1px solid #666;
}
.iconlight{margin-left: 10px; color: #FFF; cursor: pointer; border-radius: 5px; padding: 4px 7px; border: 2px solid #FFF; font-size: 12px;}
.sleep-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.5s ease;
}
body.sleep-mode {
    overflow: hidden !important; /* Ẩn scroll */
}


/*MOBILE */
@media (max-width: 640px) {
    .tab-button {
        font-size: 14px;
        padding: 10px;
    }
    .digit-flip .clock-line {
        flex-wrap: wrap;
    }
    .digit-flip .clock-container{
        padding: 0 5px;
    }
    .digit-flip .ampm-wrapper {
        width: 100%;
        margin-top: 10px;
    }
    .digit-flip .ampm {
        margin-top: 0;
    }
    .w-full .zoom-controls #zoomInBtn, .w-full .zoom-controls #zoomOutBtn{
        display: none;
    }
    .toggle-container strong{
        display: none;
    }
    .digit-flip .digit{
        padding: 0 10px;
    }
    #so .digit, .digit-flip .digit{
        font-size: 60px;
        padding: 0px 10px;
    }
    #so .digit-flip .digit{
        font-size: 80px !important;
    }
    #so .digit{
        padding-top: 20px !important;
    }
    .color-list {
        grid-template-columns: repeat(5, 1fr);
    }
    .bg-image-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .bg-image-option.active::after {
        width: 30px;
        height: 30px;
    }
    .digit-flip .digit{
        line-height: 100px;
    }

    .stopwatch-app .time-display {
        font-size: 70px;
        margin-top: 20px;
        padding: 0;
        gap:0
    }
    .stopwatch-app .hundredths {
        font-size: 34px;
    }
    .stopwatch-app .button {
        flex: 1 1 45%;
        font-size: 14px;
    }
    .stopwatch-app .container{
        padding: 10px;
    }
    .fullscreen-toggle {
        top: -35px;
        right: 0;
    }

}
.fullscreen-mode .fullscreen-toggle {
    top: 10px;
    right: 10px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    .menu-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .theme-toggle, .half-circle-icon{
        margin-right: 30px;
    }
    header nav {
        flex-direction: column;
        background: var(--primary-color);
        width: 100%;
        display: none;
    }
    nav.show {
        display: flex;
    }
    .more-toggle {
        *display: block;
    }
    .show_mobile{
        position: absolute;
        z-index: 10;
        left: 0;
        width: 100%;
        top: 45px;
        padding: 10px 0;
        background: #027353;
    }
    .show_mobile nav{
        gap:0
    }
    .show_mobile a{
        display: inline-block;
        border-bottom: 1px solid green;
        padding: 10px 15px;
        width: 100%;
    }
    .iconlight{
        display: none;
    }
    footer{
        padding: 10px;
    }
    footer nav {
        display: flex;
        flex-wrap: wrap;
        gap:5px
    }

    footer nav a {
        flex: 1 1 calc(50% - 8px); /* 2 items mỗi hàng, trừ gap */
        font-size: 14px;
        padding: 6px 10px;
        text-align: left;
    }
}

@media (max-width: 1024px) {
    .main-wrapper .side {
        display: none;
    }

    .main-wrapper .main-content {
        margin: 0 auto;
        width: 100%;
    }
}
