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

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* Disable text selection */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.dashboard-container {
    width: 100%; /* Remove max-width constraint */
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

/* Header */
.dashboard-header {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-direction: column; /* stack elements */
    align-items: center;
    gap: 25px;
    width: 100%;
    position: relative;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    top: 20px;
    right: 20px;
}



/* Update logout button for door image */
.logout-btn {
    background: transparent;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.logout-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: #6366f1;
    font-size: 24px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
}

.live-indicator {
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    transition: background 0.3s;
}

.status-indicator.connected .status-dot {
    background: #22c55e;
}

.status-indicator.disconnected .status-dot {
    background: #ef4444;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    text-align: center;
}

.stat-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center vertically */
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stat-card h2 {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.stat-card p {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

/* Player List */
.player-list-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    overflow-x: auto;
}

.list-header {
    margin-bottom: 20px;
    color: #6366f1;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-row {
    display: grid;
    grid-template-columns: 1fr 1fr 120px 100px;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #222;
    border-radius: 8px;
    transition: background 0.2s;
}

.player-row:hover {
    background: #2a2a2a;
}

.player-info {
    font-weight: 500;
    color: #ffffff;
}

.player-info.secondary {
    color: #888;
    font-weight: 400;
}

.player-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.player-status.active {
    background: #22c55e;
    color: white;
}

.player-status.afk {
    background: #f59e0b;
    color: white;
}

.player-status.afk_island {
    background: #3b82f6;
    color: white;
}

.player-duration {
    font-size: 12px;
    color: #888;
    text-align: right;
}

.empty-list {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* Footer */
.dashboard-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #888;
    font-size: 14px;
    width: 100%;
}

.footer-button {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-button:hover {
    background: #6366f1;
    border-color: #6366f1;
}

/* Debug Modal */
.debug-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.debug-modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #333;
}

.debug-header h3 {
    color: #6366f1;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-button {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-button:hover {
    background: #333;
    color: #fff;
}

.debug-log {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: #0a0a0a;
    margin: 20px;
    border-radius: 8px;
    max-height: 400px;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #222;
    color: #ccc;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry strong {
    color: #6366f1;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 15px;
        gap: 20px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .header-right {
        position: static;
        justify-content: center;
        margin-top: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card p {
        font-size: 28px;
    }
    
    .player-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .player-duration {
        grid-column: 1 / -1;
        text-align: left;
        margin-top: 8px;
    }
    
    .dashboard-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Players table */
.players-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}
.players-table thead{background:#222;}
.players-table th,.players-table td{
    padding:12px 16px;
    text-align:center;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.players-table tbody tr:nth-child(even){background:#181818;}
.players-table tbody tr{
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}
.players-table tbody tr.hiding{
    opacity: 0;
    transform: translateY(-10px);
}

/* Hide empty message when rows exist */
.players-table + .empty-list{display:none;}

/* Player category sections */
.player-category{
    margin-top:32px;
    width:100%;
    display:flex;            /* enable flex layout */
    flex-direction:column;   /* stack children */
    align-items:center;      /* horizontally center children (search box) */
}
.player-category .players-table{
    width:100%;              /* keep table full width */
}
.player-category h3{
    margin-bottom:10px;
    font-size:16px;
    color:#fff;
    font-weight:600;
    text-align:center;
}

/* Tab navigation */
.player-tabs{list-style:none;padding:0;display:flex;gap:10px;margin-top:20px;flex-wrap:wrap;justify-content:center;}
.player-tabs .tab{padding:8px 18px;background:#222;border:1px solid #444;border-radius:20px;cursor:pointer;font-size:14px;color:#bbb;user-select:none;transition:all .2s;}
.player-tabs .tab:hover{background:#333;color:#eee;}
.player-tabs .tab.active{background:#6366f1;border-color:#6366f1;color:#fff;box-shadow:0 0 8px rgba(99,102,241,.6);}

/* Tab panels */
.tab-panel{display:none;}
.tab-panel.active{display:block;}

/* Extra-small screens */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .player-tabs .tab {
        flex: 1 1 45%;
        text-align: center;
    }

    /* Mobile-friendly player table – convert to stacked cards */
    .players-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .players-table thead {
        display: none; /* hide header */
    }

    .players-table tr {
        display: block;
        width: 100%;
        background: #181818;
        margin-bottom: 12px;
        border-radius: 8px;
        padding: 12px 16px;
    }

    .players-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        white-space: normal;           /* allow wrapping */
        word-break: break-word;        /* break long names */
    }

    .players-table td:nth-child(1)::before { content: "Display"; }
    .players-table td:nth-child(2)::before { content: "Original"; }
    .players-table td:nth-child(3)::before { content: "Status"; }
    .players-table td:nth-child(4)::before { content: "Duration"; }

    .players-table td::before {
        flex: 0 0 90px;
        font-weight: 600;
        color: #888;
        margin-right: 8px;
    }

    .list-disclaimer{
        flex:1 1 100%;
        margin-top:4px;
    }
}

.list-disclaimer{
    font-size:12px;
    font-style:italic;
    color:#888;
    text-align:center;
    margin-top:4px;
}

.header-stats{
    width:100%;
}

/* Header stat cards look like regular cards */
.header-stats .stat-card{
    background:#1a1a1a;
    border:1px solid #333;
    padding:24px;
}
.header-stats .stat-card h2{font-size:14px;color:#888;margin-bottom:8px;}
.header-stats .stat-card p{font-size:32px;}

/* Hide icons in header stats to avoid extra offset */
.header-stats .stat-card h2 i {
    display: none;
}
.header-stats .stat-card h2 {
    gap: 0;
}

.player-search{
    width:100%;
    max-width:300px;
    padding:8px 12px;
    margin:8px auto 16px;
    background:#0d0d0d;
    border:1px solid #333;
    border-radius:6px;
    color:#fff;
    font-family:inherit;
    display:block;
}
.player-search::placeholder{color:#666;}

/* Player Cards */
.player-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* Much smaller cards */
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

.player-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px; /* Reduced padding */
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.player-card:hover {
    background: #2a2a2a;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.player-card.hiding {
    opacity: 0;
    transform: translateY(-10px);
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.player-display-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.player-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.player-status.active {
    background: #22c55e;
    color: white;
}

.player-status.afk {
    background: #f59e0b;
    color: white;
}

.player-status.afk_island {
    background: #3b82f6;
    color: white;
}

.player-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.player-info-label {
    color: #888;
    font-weight: 500;
}

.player-info-value {
    color: #fff;
    font-weight: 400;
}

.player-duration {
    color: #6366f1;
    font-weight: 600;
}

/* Responsive card layout */
@media (max-width: 768px) {
    .player-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .player-cards {
        grid-template-columns: 1fr;
    }
    
    .player-card {
        padding: 12px;
    }
}

/* Responsive adjustments for wider screens */
@media (min-width: 1400px) {
    .player-cards {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Even smaller on large screens */
        gap: 14px;
    }
}

@media (min-width: 1800px) {
    .player-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Maximum density */
        gap: 12px;
    }
    
    .player-card {
        padding: 12px; /* Compact padding for ultra-wide */
    }
}

/* Player Details Modal */
.player-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.player-modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.player-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #333;
}

.player-modal-header h3 {
    color: #6366f1;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.player-info-section {
    margin-bottom: 24px;
}

.player-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    color: #888;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.info-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.player-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.action-button {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.action-button:hover {
    background: #6366f1;
    border-color: #6366f1;
    transform: translateY(-1px);
}

.action-button:active {
    transform: translateY(0);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.action-button:disabled:hover {
    background: #333;
    border-color: #555;
}

.session-info-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #222;
    border-radius: 8px;
    border: 1px solid #333;
}

.session-info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-info-content .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-info-content .info-value {
    white-space: pre-line;
    word-break: break-word;
}

.session-response-section{
    margin-top:16px;
    padding:16px;
    background:#111;
    border:1px solid #333;
    border-radius:8px;
    color:#ccc;
    font-size:13px;
    line-height:1.4;
    white-space:pre-wrap;
}
.session-response-section.success{border-color:#22c55e;color:#d1fae5;}
.session-response-section.error{border-color:#ef4444;color:#fecaca;}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .player-info-grid {
        grid-template-columns: 1fr;
    }
    
    .player-actions {
        grid-template-columns: 1fr;
    }
}

.debug-log, .session-response-section, .log-entry {
    user-select: text !important;
    cursor: text;
}

/* Remove spin buttons from number inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield; /* Firefox */
}

/* Ensure ALL buttons are perfectly centered */
.action-button,
.project-btn,
.create-user-btn,
.user-action-btn,
.refresh-btn,
.footer-button,
.master-pin-submit,
.filter-btn,
.flip-back-btn,
.project-form button,
button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

/* Remove gap for buttons that should have no icon spacing */
.give-item-section #submitGiveItem,
.give-donor-section #submitGiveDonor,
.give-dollars-section #submitGiveDollars {
    gap: 0;
}

/* Ensure icons don't affect centering when hidden */
.give-item-section #submitGiveItem i,
.give-donor-section #submitGiveDonor i,
.give-dollars-section #submitGiveDollars i {
    display: none;
}

/* Custom confirmation overlay */
.custom-confirm-overlay{
    position:fixed;top:0;left:0;right:0;bottom:0;
    background:rgba(0,0,0,0.7);
    display:flex;align-items:center;justify-content:center;
    z-index:2000;
}
.custom-confirm-box{
    background:#1a1a1a;border:1px solid #333;border-radius:10px;
    padding:24px;max-width:90%;width:320px;text-align:center;
}
.custom-confirm-box p{color:#fff;margin-bottom:18px;font-size:15px;line-height:1.4;}
.custom-confirm-actions{display:flex;gap:12px;justify-content:center;}
.custom-confirm-actions .confirm-btn{
    flex:1 1 0;
    padding:10px 0;
    border:none;border-radius:6px;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;
}
.confirm-yes{background:#22c55e;color:#fff;}
.confirm-no{background:#ef4444;color:#fff;}

/* Custom input modal overlay */
.custom-input-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: fadeIn 0.2s ease;
}

.custom-input-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #6366f1;
    border-radius: 16px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    animation: slideInModal 0.3s ease;
}

.custom-input-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #333;
}

.custom-input-header h3 {
    margin: 0;
    color: #6366f1;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.custom-input-body {
    padding: 24px;
}

.custom-input-label {
    display: block;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.custom-input-field,
.custom-input-select {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.custom-input-field:focus,
.custom-input-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-input-select {
    cursor: pointer;
}

.custom-input-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-input-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.save-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.cancel-btn {
    background: #374151;
    color: #fff;
    border: 1px solid #4b5563;
}

.cancel-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.top-tabs{list-style:none;padding:0;display:flex;gap:10px;margin:20px 0;flex-wrap:wrap;justify-content:center;}
.top-tab{padding:8px 18px;background:#222;border:1px solid #444;border-radius:20px;cursor:pointer;font-size:14px;color:#bbb;user-select:none;transition:all .2s;}
.top-tab:hover{background:#333;color:#eee;}
.top-tab.active{background:#6366f1;border-color:#6366f1;color:#fff;box-shadow:0 0 8px rgba(99,102,241,.6);} 
/* PROJECT TRACKER STYLES */
.project-tracker-container {
    padding: 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 100%;
}

.project-input-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border: 1px solid #444;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.project-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: center;
    text-align: center;
}

.project-form input[type="text"],
.project-form textarea {
    padding: 12px 16px;
    background: #0d0d0d;
    border: 2px solid #333;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
    resize: vertical;
}

.project-form input[type="text"]:focus,
.project-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.project-form input[type="text"]::placeholder,
.project-form textarea::placeholder {
    text-align: center;
    color: #666;
}

.priority-checkboxes,
.category-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.priority-checkboxes h4,
.category-checkboxes h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #bbb;
    font-size: 14px;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #fff;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-radius: 4px;
    background: #0d0d0d;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #6366f1;
    border-color: #6366f1;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    font-weight: bold;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.project-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    background: #222;
    border: 1px solid #444;
    border-radius: 20px;
    color: #bbb;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.filter-btn:hover {
    background: #333;
    color: #eee;
}

.filter-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.project-card {
    background: transparent;
    border: none;
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    perspective: 1000px;
    height: 320px;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.flipped .project-card-inner {
    transform: rotateY(180deg);
}

.project-card-front,
.project-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border: 1px solid #444;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1e1e2a 0%, #1a1a1e 100%);
}

.project-card:hover .project-card-front,
.project-card:hover .project-card-back {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: #6366f1;
}

.project-card-front::before,
.project-card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

.project-card.priority-urgent .project-card-front::before,
.project-card.priority-urgent .project-card-back::before {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.project-card.priority-high .project-card-front::before,
.project-card.priority-high .project-card-back::before {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}

.project-card.priority-medium .project-card-front::before,
.project-card.priority-medium .project-card-back::before {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.project-card.priority-low .project-card-front::before,
.project-card.priority-low .project-card-back::before {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    position: relative;
}

.project-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.project-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-priority,
.project-category {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.project-category {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #bbb;
}



.project-description {
    color: #bbb;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.project-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-progress-slider {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #333 0%, #222 100%);
    border-radius: 6px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.project-progress-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--progress-color, #ef4444);
    border-radius: 6px;
    transition: width 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.project-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.6);
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    border: 2px solid white;
}

.project-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.8);
}

.project-progress-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.project-progress-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    transform: none;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
}

.project-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    justify-content: center;
    align-items: center;
}

.project-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-btn.edit {
    background: #3b82f6;
    color: white;
}

.project-btn.delete {
    background: #ef4444;
    color: white;
}

.project-btn.complete {
    background: #22c55e;
    color: white;
}

.project-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.completed-archive {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.completed-archive h3 {
    color: #888;
    font-size: 16px;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.completed-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.completed-project {
    background: #1a1a1a;
    border: 1px dashed #444;
    border-radius: 12px;
    padding: 16px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.completed-project:hover {
    opacity: 1;
}



.notes-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.notes-section h4 {
    color: #6366f1;
    font-size: 16px;
    margin: 0;
    text-align: center;
}

.project-notes {
    flex: 1;
    background: #0d0d0d;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.project-notes:focus {
    border-color: #6366f1;
}

.flip-back-btn {
    background: #333;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.flip-back-btn:hover {
    background: #444;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .project-form {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-filters {
        flex-direction: column;
        align-items: center;
    }
}

/* -----------------------------
   Custom Scrollbar (always visible)
------------------------------ */
html {
    /* Reserve space for vertical scrollbar even when not needed */
    overflow-y: scroll;
    scrollbar-gutter: stable; /* modern browsers */
}

/* For WebKit (Chrome, Edge, Safari) */
html::-webkit-scrollbar {
    width: 10px;
}
html::-webkit-scrollbar-track {
    background: #111; /* track color */
}
html::-webkit-scrollbar-thumb {
    background: #444; /* thumb color */
    border-radius: 6px;
}
html::-webkit-scrollbar-thumb:hover {
    background: #6366f1; /* hover accent */
}

/* Apply same style to any internal scrollable element */
*::-webkit-scrollbar {
    width: 10px;
}
*::-webkit-scrollbar-track {
    background: #111;
}
*::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 6px;
}
*::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Firefox */
html, * {
    scrollbar-width: thin;             /* always reserve space */
    scrollbar-color: #444 #111;        /* thumb and track */
}

/* -----------------------------
   To-Do List Styles
------------------------------ */
/* Additional project form styles */
.project-form button {
    grid-column: 1 / -1;
    padding: 12px 24px;
    background: #6366f1;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.project-form button:hover {
    background: #7c7ef6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Master PIN Login Overlay */
.master-pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.master-pin-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #6366f1;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    max-width: 400px;
    width: 90%;
}

.master-pin-title {
    color: #6366f1;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.master-pin-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

.master-pin-input {
    width: 100%;
    padding: 15px 20px;
    background: #0d0d0d;
    border: 2px solid #333;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 20px;
    outline: none;
    transition: all 0.3s ease;
}

.master-pin-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.master-pin-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.master-pin-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.master-pin-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.master-pin-error.show {
    opacity: 1;
}

.dashboard-container.pin-locked {
    display: none !important;
}

/* ===== MASTER PINS SECTION STYLES ===== */
.master-pins-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.master-pins-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    margin-top: 24px;
}

.user-creation-panel {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.user-creation-panel h3 {
    color: #fff;
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-creation-panel h3 i {
    color: #6366f1;
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.access-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.access-level-option {
    padding: 8px 12px;
    background: #222;
    border: 2px solid #333;
    border-radius: 8px;
    color: #bbb;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.access-level-option:hover {
    background: #333;
    border-color: #444;
}

.access-level-option.selected {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    font-weight: 500;
}

.create-user-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.create-user-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.create-user-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.user-management-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.user-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.user-management-header h3 {
    color: #fff;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-management-header h3 i {
    color: #10b981;
    font-size: 18px;
}

.refresh-btn {
    padding: 8px 16px;
    background: #374151;
    color: #fff;
    border: 1px solid #4b5563;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
}

.users-grid {
    display: grid;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.user-card-modern {
    background: linear-gradient(135deg, #222 0%, #1a1a1a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.user-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: #444;
}

.user-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #10b981);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.user-card-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-card-title i {
    color: #6366f1;
    font-size: 16px;
}

.user-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-status-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.user-status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.user-card-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.user-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-info-label {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-info-value {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.user-info-value.access-level {
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    color: #a5b4fc;
    font-size: 12px;
    width: fit-content;
}

.user-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-action-btn {
    padding: 8px 14px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    background: transparent;
    text-align: center;
    min-width: 100px;
    white-space: nowrap;
}

/* Ensure text in user action buttons is perfectly centered */
.user-action-btn i {
    flex-shrink: 0;
}

.user-action-btn span,
.user-action-btn {
    line-height: 1;
}

.user-action-btn.reset {
    color: #f59e0b;
    border-color: #f59e0b;
}

.user-action-btn.reset:hover {
    background: #f59e0b;
    color: #000;
}

.user-action-btn.update {
    color: #3b82f6;
    border-color: #3b82f6;
}

.user-action-btn.update:hover {
    background: #3b82f6;
    color: #fff;
}

.user-action-btn.delete {
    color: #ef4444;
    border-color: #ef4444;
}

.user-action-btn.delete:hover {
    background: #ef4444;
    color: #fff;
}

.user-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-creation-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    animation: slideIn 0.3s ease-out;
}

.user-creation-success h4 {
    color: #22c55e;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-creation-success h4 i {
    color: #22c55e;
}

.success-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.success-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.success-info-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.success-info-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.success-info-value.pin {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 2px;
}

.success-warning {
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
    margin-top: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #374151;
}

.empty-state h4 {
    margin: 0 0 8px 0;
    color: #9ca3af;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #374151;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .master-pins-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .user-creation-panel {
        position: static;
    }
    
    .user-card-info {
        grid-template-columns: 1fr;
    }
    
    .user-card-actions {
        flex-direction: column;
    }
    
    .user-action-btn {
        justify-content: center;
    }
}

/* Dashboard Section */
.dashboard-main-container {
    width: 100%;
    margin: 0;
    padding: 20px 30px;
}

.ingame-sync-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ingame-sync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    gap: 16px;
}

.ingame-sync-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ingame-sync-header h3 i {
    color: #6366f1;
    margin-right: 10px;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    transition: all 0.3s ease;
}

.sync-status.connected .sync-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.sync-status.disconnected .sync-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

#syncStatusText {
    color: #888;
    font-size: 14px;
}

.ingame-sync-content {
    background: linear-gradient(135deg, #0d0d0d 0%, #0a0a0a 100%);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
    max-height: 70vh;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #e5e5e5;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ingame-sync-content .loading-message {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    height: 100px;
    color: #888;
}

.ingame-sync-content .loading-message i {
    font-size: 16px;
}

.sync-message {
    margin-bottom: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sync-message:hover {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(25, 25, 25, 1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.sync-message:last-child {
    margin-bottom: 0;
}

.sync-message .timestamp {
    color: #d4d4d4;
    font-size: 12px;
    font-weight: 500;
    min-width: fit-content;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    margin-top: 1px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 6px;
}

.sync-message .content {
    color: #e5e5e5;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    flex: 1;
}

.sync-message .content strong {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sync-message .content .username {
    color: #22c55e;
    font-weight: 500;
}

.sync-message .content .action {
    color: #f59e0b;
}

.sync-message .content .item {
    color: #8b5cf6;
}

.sync-message .content .location {
    color: #06b6d4;
}

.clickable-username {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px;
    display: inline-block;
    position: relative;
}

.clickable-username:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    text-shadow: 0 0 8px currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.clickable-username strong {
    color: inherit !important;
    font-weight: 600;
}

.clickable-username:hover strong {
    color: inherit !important;
}

.ingame-sync-content::-webkit-scrollbar {
    width: 8px;
}

.ingame-sync-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.ingame-sync-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.ingame-sync-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.sync-search {
    width: 200px;
    padding: 8px 12px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sync-search:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.sync-search::placeholder {
    color: #666;
}

.scroll-to-bottom {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    z-index: 1000;
    opacity: 1;
    pointer-events: auto;
}

.scroll-to-bottom:hover {
    background: #7c7ef6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.6);
}

.scroll-to-bottom.show {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1.1);
}

.scroll-arrow-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}



@media (max-width: 768px) {
    .sync-search {
        width: 100%;
        order: 2;
    }
}