/**
 * Credential Hub - Dashboard View Styles
 * Tab panels, glass cards, stats grid, toolbar, vault table, and log console.
 */

:root {
    color-scheme: dark;
    --bg-color: #080d12;
    --surface-color: rgba(16, 26, 32, 0.75);
    --surface-border: rgba(255, 255, 255, 0.08);
    --accent-emerald: #8b5cf6;
    --accent-emerald-glow: rgba(139, 92, 246, 0.35);
    --accent-cyan: #6366f1;
    --accent-purple: #a855f7;
    --accent-crimson: #ff4d6d;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.35);
    border-radius: 3px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 10% 10%, rgba(139, 92, 246, 0.16) 0px, transparent 45%),
        radial-gradient(at 90% 90%, rgba(99, 102, 241, 0.12) 0px, transparent 45%),
        radial-gradient(at 50% 50%, rgba(11, 19, 26, 0.95) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 1550px;
    margin: 0 auto;
    padding: 30px 24px;
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--surface-border);
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-emerald-glow);
}

.header-icon span {
    font-size: 28px;
    color: #fff;
}

h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn.primary-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-emerald-glow);
}
.btn.primary-btn:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn.secondary-btn {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
    color: #38bdf8;
}
.btn.secondary-btn:hover {
    background: rgba(6, 182, 212, 0.3);
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.stat-icon.green { color: #10b981; background: rgba(16, 185, 129, 0.15); }
.stat-icon.cyan { color: #06b6d4; background: rgba(6, 182, 212, 0.15); }
.stat-icon.purple { color: #a855f7; background: rgba(168, 85, 247, 0.15); }
.stat-icon.crimson { color: #ff4d6d; background: rgba(255, 77, 109, 0.15); }

.stat-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.stat-info p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* MAIN CONTENT LAYOUT */
.content-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--glass-shadow);
    min-width: 0;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface-border);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.card-title span.icon {
    color: var(--accent-emerald);
    font-size: 20px;
}

/* FORMS & INPUTS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    min-width: 0;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    background: #0d151c;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--accent-emerald);
}

select.form-input option {
    background: #0d151c;
    color: #fff;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.small-btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* TOOLBAR */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    background: rgba(13, 21, 28, 0.6);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* VAULT TABLE */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: rgba(11, 18, 24, 0.9);
}

.vault-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.vault-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--surface-border);
    white-space: nowrap;
}

.vault-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
    color: #d1d5e0;
    vertical-align: middle;
}

.vault-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cookie-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.action-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-icon-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.action-icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.rotation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.rotation-toggle input[type="checkbox"] {
    accent-color: #10b981;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* CONSOLE LOG */
.log-container {
    margin-top: 20px;
    background: #060a0e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    height: 180px;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-entry {
    line-height: 1.4;
    color: #a0a5b5;
}

.log-entry .time {
    color: #475569;
    margin-right: 8px;
}

.log-entry.info { color: #38bdf8; }
.log-entry.success { color: #34d399; }
.log-entry.warn { color: #fbbf24; }
.log-entry.error { color: #f87171; }
