/* css/user-dashboard.css - Modern Sleek Responsive User Dashboard Modal */
.user-dash-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}

.user-dash-card {
    background: linear-gradient(165deg, #181c24 0%, #11141a 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(10, 132, 255, 0.12);
    color: #fff;
    overflow: hidden;
    position: relative;
    animation: userDashFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes userDashFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.user-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.user-dash-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.user-dash-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #aaa;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.user-dash-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.05);
}

/* Tabs Bar */
.user-dash-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 20px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    overflow-x: auto;
    scrollbar-width: none;
}

.user-dash-tabs::-webkit-scrollbar {
    display: none;
}

.user-dash-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary, #9ca3af);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: all 0.2s;
}

.user-dash-tab-btn:hover {
    color: #fff;
}

.user-dash-tab-btn.active {
    color: #0A84FF;
    border-bottom-color: #0A84FF;
}

/* Body Content Panes */
.user-dash-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.user-dash-body::-webkit-scrollbar {
    width: 6px;
}
.user-dash-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

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

.user-info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 14px;
    transition: background 0.2s;
}

.user-info-box:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-info-label {
    font-size: 11px;
    color: #8e8e93;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.user-info-val {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
}

/* Badges */
.badge-tier {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
    letter-spacing: 0.5px;
}

.badge-admin { background: rgba(255, 107, 53, 0.2); color: #ff6b35; border: 1px solid rgba(255, 107, 53, 0.4); }
.badge-vip { background: rgba(255, 215, 0, 0.2); color: #FFD700; border: 1px solid rgba(255, 215, 0, 0.4); }
.badge-free { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Password Form */
.password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.user-dash-form-group {
    margin-bottom: 12px;
}

.user-dash-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #c4c4cc;
    margin-bottom: 5px;
}

.user-dash-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #191c24;
    color: #fff;
    font-size: 13.5px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}

.user-dash-input:focus {
    border-color: #0A84FF;
    background: #1d212b;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

/* API Key Box */
.api-key-box {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px 0;
}

.api-key-input {
    flex: 1;
    min-width: 0;
    height: 34px !important;
    background: transparent !important;
    border: none !important;
    color: #00e676 !important;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    outline: none !important;
    padding: 0 4px !important;
    box-shadow: none !important;
}

.api-key-box .udash-btn {
    flex-shrink: 0;
}

.code-snippet {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    color: #e6edf3;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
    margin-top: 8px;
}

/* History Badges & Table */
.badge-type {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-type-fast { background: rgba(10, 132, 255, 0.15); color: #0A84FF; border: 1px solid rgba(10, 132, 255, 0.3); }
.badge-type-slow { background: rgba(255, 159, 28, 0.15); color: #ff9f1c; border: 1px solid rgba(255, 159, 28, 0.3); }
.badge-type-bot { background: rgba(0, 230, 118, 0.15); color: #00e676; border: 1px solid rgba(0, 230, 118, 0.3); }

.history-stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.hstat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 9px 6px;
    text-align: center;
}

.hstat-num {
    font-size: 16px;
    font-weight: 800;
    margin-top: 2px;
}

.hstat-label {
    font-size: 10.5px;
    color: #8e8e93;
    text-transform: uppercase;
    font-weight: 600;
}

/* COMPACT ACTION BAR FOR HISTORY (Fixes big button issue) */
.history-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.history-action-label {
    font-size: 12px;
    color: #8e8e93;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Explicit compact styling for User Dashboard buttons */
.udash-btn {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 11px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: auto !important;
    box-shadow: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
}

.btn-download-history {
    background: rgba(10, 132, 255, 0.15) !important;
    border: 1px solid rgba(10, 132, 255, 0.35) !important;
    color: #0A84FF !important;
}

.btn-download-history:hover {
    background: rgba(10, 132, 255, 0.25) !important;
    color: #fff !important;
}

.btn-refresh-history {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #aaa !important;
}

.btn-refresh-history:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
}

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS (TABLETS & PHONES)
   ========================================================================== */

@media (max-width: 768px) {
    .user-dash-modal-overlay {
        padding: 8px;
    }

    .user-dash-card {
        max-height: 94vh;
        border-radius: 16px;
    }

    .user-dash-header {
        padding: 13px 16px;
    }

    .user-dash-title {
        font-size: 15px;
    }

    .user-dash-tabs {
        padding: 6px 14px 0 14px;
        gap: 2px;
    }

    .user-dash-tab-btn {
        font-size: 12px;
        padding: 8px 10px;
    }

    .user-dash-body {
        padding: 14px;
    }

    .user-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .password-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .history-stats-bar {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* Keep buttons compact & inline horizontally even on mobile */
    .history-action-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .history-btn-group {
        display: inline-flex;
        width: auto;
        gap: 6px;
    }

    .history-btn-group > button {
        flex: 0 0 auto;
    }
}

@media (max-width: 480px) {
    .user-dash-modal-overlay {
        padding: 4px;
    }

    .user-dash-card {
        max-height: 96vh;
        border-radius: 14px;
    }

    .user-dash-header {
        padding: 11px 12px;
    }

    .user-dash-tabs {
        padding: 4px 8px 0 8px;
    }

    .user-dash-tab-btn {
        font-size: 11px;
        padding: 7px 8px;
    }

    .user-dash-body {
        padding: 10px;
    }

    .user-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .history-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .history-action-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .history-btn-group {
        width: 100%;
        display: flex;
        gap: 6px;
    }

    .history-btn-group .udash-btn {
        flex: 1;
    }

    .api-key-box {
        flex-wrap: nowrap;
    }

    .api-key-input {
        min-width: 0;
        flex: 1;
    }
}
