/* style.css */

:root {
    --bg-main: #1c1c1e;
    --text-main: #ffffff;
    --accent-color: #d4af37;
    --bg-panel: #2c2c2e;
    --border-color: #3a3a3c;
    --input-bg: #1c1c1e;
    --input-border: #3a3a3c;
    --bg-color: #000000;
    --text-muted: #8e8e93;
    --danger-color: #ff453a;
    --glass-bg: rgba(44, 44, 46, 0.8);
}

html.light-mode, body.light-mode {
    --bg-main: #f5f5f7;
    --text-main: #1d1d1f;
    --accent-color: #af8d1d;
    --bg-panel: #ffffff;
    --border-color: #d2d2d7;
    --input-bg: #f5f5f7;
    --input-border: #d2d2d7;
    --bg-color: #f5f5f7;
    --text-muted: #86868b;
    --glass-bg: rgba(255, 255, 255, 0.8);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

html.light-mode body, body.light-mode { color-scheme: light; }
html:not(.light-mode) body:not(.light-mode) { color-scheme: dark; }

/* --- KHUNG GIẢ LẬP ĐIỆN THOẠI --- */
.mobile-wrapper {
    width: 100%;
    max-width: 414px; /* Kích thước iPhone Max */
    height: 100vh;
    background-color: var(--bg-main);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    transition: background-color 0.3s;
}

@media (min-width: 450px) {
    .mobile-wrapper {
        height: 92vh;
        border-radius: 40px;
        border: 10px solid #2d2d2d;
    }
}

/* --- HEADER --- */
header {
    padding: 40px 20px 10px 20px; /* Padding top lớn để né tai thỏ */
    background: var(--bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    transition: background-color 0.3s;
}

header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    background: -webkit-linear-gradient(45deg, var(--accent-color), #f2f2f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Hiệu ứng chữ ánh kim */
}

.profile-pic {
    width: 40px; height: 40px;
    background: var(--bg-panel);
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.notif-wrapper { position: relative; display:flex; align-items:center; }
.notif-btn { width: 40px; height: 40px; background: transparent; border: 2px solid var(--accent-color); border-radius: 50%; color: var(--text-main); display:flex; align-items:center; justify-content:center; position: relative; }
.notif-btn i { font-size: 18px; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--danger-color); color: #fff; font-size: 10px; border-radius: 10px; padding: 2px 5px; }
.notif-dropdown { position: absolute; right: 0; top: 52px; width: 280px; background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); display: none; z-index: 1000; }
.notif-header { padding: 10px 12px; font-weight: 600; color: var(--accent-color); border-bottom: 1px solid var(--border-color); }
.notif-list { max-height: 260px; overflow-y: auto; }
.notif-item { padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.notif-item:last-child { border-bottom: none; }
.notif-title { font-size: 13px; color: var(--text-main); }
.notif-time { font-size: 11px; color: var(--text-muted); }

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    padding-bottom: 80px; /* Chừa chỗ cho menu dưới */
}

/* Tùy chỉnh FullCalendar cho đẹp */
.fc { 
    --fc-border-color: var(--border-color);
    --fc-page-bg-color: var(--bg-main);
    --fc-neutral-bg-color: rgba(255,255,255,0.1);
    --fc-list-event-hover-bg-color: var(--bg-panel);
    font-size: 0.9em;
}
.fc-toolbar-title { font-size: 1.2em !important; font-weight: 600; color: var(--text-main); }
.fc-button {
    background-color: rgba(255,255,255,0.1) !important;
    border: none !important;
    font-size: 0.8em !important;
    color: var(--text-main) !important;
}
.fc-day-today { background: rgba(212, 175, 55, 0.15) !important; } /* Highlight ngày nay */

/* --- FOOTER / BOTTOM NAV --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px); /* Hiệu ứng kính mờ */
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 10px; /* Cho các dòng iPhone đời mới */
    z-index: 1000;
    transition: background-color 0.3s, border-color 0.3s;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    transition: 0.3s;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 5px;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item span { color: inherit; }

/* --- FAB BUTTON (Nút thêm) --- */
.fab-add {
    position: absolute;
    bottom: 90px;
    right: 20px;
    width: 55px; height: 55px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: black;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    cursor: pointer;
    border: none;
    z-index: 99;
}

/* --- MODAL --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2001;
    align-items: flex-end; /* Modal trượt từ dưới lên */
}

.modal-sheet {
    background: var(--bg-panel);
    width: 100%;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
    animation: slideUp 0.3s ease-out;
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

.upgrade-sheet{
    padding: 0;
    overflow: hidden;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    box-shadow: 0 22px 70px rgba(0,0,0,.65);
}
.upgrade-hero{
    padding: 18px 18px 14px 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel);
}
.upgrade-close{
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,.04);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.upgrade-close:hover{ background: rgba(255,255,255,.08); color: var(--text-main); }
.upgrade-hero-icon{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d4af37, #f2f2f7);
    color: #000;
    flex: 0 0 auto;
}
.upgrade-hero-title{
    font-weight: 800;
    letter-spacing: .2px;
    color: var(--text-main);
    margin: 0;
    font-size: 18px;
}
.upgrade-hero-sub{
    margin: 2px 0 0 0;
    color: var(--text-muted);
    font-size: 12px;
}
.upgrade-body{ padding: 16px 18px 18px 18px; }
.upgrade-toggle{
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 12px;
}
.upgrade-toggle:active{ transform: translateY(1px); }
.upgrade-block{
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    border-radius: 16px;
    padding: 12px;
}
.upgrade-block + .upgrade-block{ margin-top: 12px; }
.upgrade-label{ font-size: 11px; color: var(--text-muted); margin-bottom: 6px; display:block; }
.upgrade-row{ display:flex; gap:10px; align-items:center; }
.upgrade-row .custom-input{ flex: 1; }
.upgrade-row .btn-save{ width: 92px; padding: 10px 10px; font-size: 12px; margin-top: 0; }
.upgrade-msg{ font-size: 11px; margin-top: 6px; }
.upgrade-qr-wrap{
    display:flex;
    justify-content:center;
    padding: 12px;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    background: var(--bg-panel);
}
.upgrade-qr{
    width: 220px;
    height: 220px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    object-fit: contain;
}
.upgrade-note{
    font-size: 11px;
    color: var(--accent-color);
    text-align: center;
    font-style: italic;
    margin-top: 10px;
    line-height: 1.35;
}
.upgrade-actions{ display:flex; gap:10px; margin-top: 12px; }
.upgrade-actions .btn-save{ flex:1; margin-top:0; }
@media (min-width: 450px){
    .upgrade-sheet{ max-width: 420px; margin: 0 auto; }
}

.notejob-sheet{
    padding: 0;
    overflow: hidden;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    box-shadow: 0 22px 70px rgba(0,0,0,.3);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}
.notejob-hero{
    padding: 18px 18px 14px 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel);
}
.notejob-hero-icon{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), #f2f2f7);
    color: #000;
    flex: 0 0 auto;
}
.notejob-hero-title{
    font-weight: 800;
    letter-spacing: .2px;
    color: var(--text-main);
    margin: 0;
    font-size: 18px;
}
.notejob-hero-sub{
    margin: 2px 0 0 0;
    color: var(--text-muted);
    font-size: 12px;
}
.notejob-close{
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.notejob-close:hover{ background: var(--border-color); color: var(--text-main); }
.notejob-body{ padding: 16px 18px 18px 18px; }
.notejob-card{
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    border-radius: 16px;
    padding: 12px;
    color: var(--text-main);
}
.notejob-actions{ display:flex; gap:10px; margin-top: 12px; }
.notejob-btn{
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    border: 1px solid var(--border-color);
}
.notejob-content{
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    border-radius: 16px;
    padding: 12px;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
}
@media (min-width: 450px){
    .notejob-sheet{ max-width: 420px; margin: 0 auto; }
}

@keyframes slideUp { from {transform: translateY(100%);} to {transform: translateY(0);} }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 12px; }
.form-control {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-main);
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn-primary {
    width: 100%; padding: 15px;
    background: var(--accent-color);
    border: none; border-radius: 12px;
    color: black; font-weight: bold; font-size: 16px;
    cursor: pointer;
}
.notif-btn#refreshBtn { width: 40px; height: 40px; border-width: 2px; margin-left: 8px; }
.notif-btn#refreshBtn i { font-size: 18px; }
.notif-btn{color:var(--text-main);border-color:var(--border-color);background:transparent}
.notif-dropdown{background:var(--bg-panel);color:var(--text-main);border:1px solid var(--border-color)}
.modal-sheet{background:var(--bg-panel);color:var(--text-main)}
.form-control{background:var(--input-bg);border-color:var(--input-border);color:var(--text-main)}
.custom-input{background:var(--input-bg);border-color:var(--input-border);color:var(--text-main)}
.bottom-nav{background:var(--glass-bg);border-top:1px solid var(--border-color)}
.nav-item{color:var(--text-muted)}
.nav-item.active { color: var(--accent-color); }
.stats-tabs{display:flex;gap:8px;justify-content:center;flex-wrap:nowrap}
.stats-tab{white-space:nowrap;padding:8px 12px;font-size:12px;width:auto;background:var(--bg-panel);border:1px solid var(--border-color);border-radius:10px;color:var(--text-main)}
.stats-tab.active{background:var(--accent-color);color:#000;border-color:var(--accent-color)}
/* Notejob Button Group & Specific Buttons */
.notejob-button-group {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-contact, .btn-notejob {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border: none !important;
    margin-top: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-contact {
    background: linear-gradient(135deg, var(--accent-color), #b8860b) !important;
    color: #000 !important;
}

.btn-notejob {
    background: linear-gradient(135deg, #5856d6, #af52de) !important;
    color: #ffffff !important;
}

.btn-contact i, .btn-notejob i {
    font-size: 14px;
}

.btn-contact:hover, .btn-notejob:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.btn-contact:active, .btn-notejob:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Info content styling */
.notejob-content {
    background: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    max-height: 60vh;
    overflow-y: auto;
}

/* Responsive adjustments for desktop */
@media (min-width: 450px) {
    .notejob-button-group {
        gap: 12px;
    }
    
    .btn-contact, .btn-notejob {
        padding: 12px 15px;
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .notejob-button-group {
        gap: 16px;
    }
    
    .btn-contact, .btn-notejob {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .notejob-content {
        padding: 20px;
        font-size: 15px;
    }
}

/* Notejob History Styles */
.notejob-history-title {
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.notejob-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.notejob-history-item {
    background: var(--bg-main);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
}

.notejob-history-ver {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notejob-history-date {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.notejob-history-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Custom scrollbar for history list */
.notejob-history-list::-webkit-scrollbar {
    width: 4px;
}
.notejob-history-list::-webkit-scrollbar-track {
    background: transparent;
}
.notejob-history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.notejob-load-more {
    width: 100%;
    padding: 10px;
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.notejob-load-more:hover {
    background: var(--border-color);
    color: var(--text-main);
}
