/* ========================================
   DRAGONFIRE CLUB DASHBOARD v2
   Comprehensive Service Hub Styles
   ======================================== */

/* Variables - Dark Theme (Default) */
:root {
    --bg-dark: #0a0a12;
    --bg-card: rgba(255,255,255,0.03);
    --bg-card-hover: rgba(255,255,255,0.06);
    --bg-input: rgba(255,255,255,0.1);
    --border-color: rgba(255,255,255,0.1);
    --border-hover: rgba(255,255,255,0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.8);
    --text-muted: rgba(255,255,255,0.6);
    --text-faint: rgba(255,255,255,0.4);
    --white-05: rgba(255,255,255,0.05);
    --white-10: rgba(255,255,255,0.1);
    --white-20: rgba(255,255,255,0.2);
    --white-40: rgba(255,255,255,0.4);
    --white-60: rgba(255,255,255,0.6);
    --white-80: rgba(255,255,255,0.8);
    --gold: #ffaa00;
    --fire: #ff6b35;
    --teal: #00d4ff;
    --purple: #a855f7;
    --success: #22c55e;
    --danger: #ef4444;
    --navy: #1a1a2e;
    --sidebar-bg: rgba(0,0,0,0.2);
    --header-bg: rgba(0,0,0,0.3);
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #f5f7fa;
    --bg-card: rgba(0,0,0,0.02);
    --bg-card-hover: rgba(0,0,0,0.05);
    --bg-input: rgba(0,0,0,0.05);
    --border-color: rgba(0,0,0,0.1);
    --border-hover: rgba(0,0,0,0.2);
    --text-primary: #1a1a2e;
    --text-secondary: #2d2d44;
    --text-muted: #555566;
    --text-faint: #888899;
    --white-05: rgba(0,0,0,0.03);
    --white-10: rgba(0,0,0,0.08);
    --white-20: rgba(0,0,0,0.12);
    --white-40: rgba(0,0,0,0.4);
    --white-60: rgba(0,0,0,0.55);
    --white-80: rgba(0,0,0,0.75);
    --gold: #d49000;
    --fire: #e55520;
    --teal: #0099cc;
    --purple: #8b44e0;
    --success: #16a34a;
    --danger: #dc2626;
    --navy: #ffffff;
    --sidebar-bg: rgba(255,255,255,0.8);
    --header-bg: rgba(255,255,255,0.9);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: background 0.3s, border-color 0.3s;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo img {
    width: 36px;
    height: 36px;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--fire), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--white-60);
    font-size: 0.9rem;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--white-20);
    color: var(--white-60);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ========================================
   MAIN LAYOUT
   ======================================== */
.main {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    transition: background 0.3s, border-color 0.3s;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--white-05);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255,170,0,0.15), transparent);
    color: var(--gold);
    border-left-color: var(--gold);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--gold);
    color: black;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--white-60);
    font-size: 1rem;
}

/* ========================================
   SERVICE CARDS (Dashboard Grid)
   ======================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--fire), var(--gold));
    opacity: 0;
    transition: opacity 0.3s;
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-icon.sites { background: linear-gradient(135deg, var(--teal), #0099cc); color: white; }
.service-icon.panel { background: linear-gradient(135deg, var(--gold), var(--fire)); color: white; }
.service-icon.ai { background: linear-gradient(135deg, var(--purple), #7c3aed); color: white; }
.service-icon.servers { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.service-icon.mail { background: linear-gradient(135deg, #f97316, #ea580c); color: white; }
.service-icon.security { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }

.service-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.service-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.service-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.service-status.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.service-status.inactive {
    background: var(--white-10);
    color: var(--white-40);
}

/* ========================================
   PANEL CARDS
   ======================================== */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    transition: background 0.3s, border-color 0.3s;
}

.panel-card:last-child {
    margin-bottom: 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header i {
    color: var(--gold);
    font-size: 1rem;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ========================================
   PRICING TIERS
   ======================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pricing-card {
    background: var(--white-05);
    border: 1px solid var(--white-10);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.pricing-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}

.pricing-card.popular {
    border-color: var(--gold);
}

.pricing-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--fire), var(--gold));
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
}

.pricing-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pricing-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.pricing-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--white-40);
}

.pricing-features {
    list-style: none;
    margin: 1rem 0;
    text-align: left;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white-60);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.pricing-features li i {
    color: var(--success);
    font-size: 0.75rem;
}

.pricing-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--fire), var(--gold));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pricing-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.3);
}

.pricing-btn.secondary {
    background: var(--white-10);
    border: 1px solid var(--white-20);
}

/* ========================================
   INFO ROWS
   ======================================== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--white-05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.95rem;
    color: var(--text-faint);
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-value.gold { color: var(--gold); }
.info-value.teal { color: var(--teal); }

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
}

.form-input::placeholder {
    color: var(--text-faint);
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--white-40);
    cursor: pointer;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--fire), var(--gold));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.3);
}

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

.btn-secondary {
    width: 100%;
    padding: 0.875rem;
    background: var(--white-10);
    border: 1px solid var(--white-20);
    border-radius: 10px;
    color: var(--white-60);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--white-20);
    color: white;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

/* ========================================
   STATUS BADGES
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.pending {
    background: rgba(255, 170, 0, 0.15);
    color: var(--gold);
}

/* ========================================
   DEVICE LIST
   ======================================== */
.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--white-05);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.device-item:last-child {
    margin-bottom: 0;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.device-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--white-10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-60);
    font-size: 1.1rem;
}

.device-name {
    font-weight: 500;
    color: var(--text-primary);
}

.device-meta {
    font-size: 0.85rem;
    color: var(--text-faint);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--white-40);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

/* ========================================
   WALLET
   ======================================== */
.wallet-balance {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.wallet-label {
    color: var(--white-40);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.wallet-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--purple);
}

.wallet-amount span {
    font-size: 1rem;
    color: var(--white-40);
}

.topup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.topup-btn {
    padding: 0.75rem;
    background: var(--white-05);
    border: 1px solid var(--white-20);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.topup-btn:hover {
    background: var(--white-10);
    border-color: var(--purple);
}

.topup-btn.selected {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--purple);
    color: var(--purple);
}

/* ========================================
   API KEY BOX
   ======================================== */
.api-key-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--white-10);
    border-radius: 10px;
    padding: 1rem;
}

.api-key-box code {
    flex: 1;
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--teal);
    word-break: break-all;
}

.copy-btn {
    background: var(--white-10);
    border: 1px solid var(--white-20);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    color: var(--white-60);
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--white-20);
    color: white;
}

/* ========================================
   CALLOUTS
   ======================================== */
.info-callout {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(0, 212, 255, 0.08);
    border-left: 3px solid var(--teal);
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--white-60);
}

.info-callout i {
    color: var(--teal);
    flex-shrink: 0;
}

.warning-callout {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(255, 107, 53, 0.08);
    border-left: 3px solid var(--fire);
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--white-60);
}

.warning-callout i {
    color: var(--fire);
    flex-shrink: 0;
}

/* ========================================
   MNEMONIC DISPLAY
   ======================================== */
.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.mnemonic-word {
    background: var(--white-05);
    border: 1px solid var(--white-10);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
}

.mnemonic-word .num {
    font-size: 0.65rem;
    color: var(--white-40);
    display: block;
}

.mnemonic-word .word {
    font-family: monospace;
    color: var(--gold);
    font-weight: 500;
}

/* ========================================
   DOWNLOAD BOX
   ======================================== */
.download-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.1), rgba(255, 107, 53, 0.05));
    border: 1px solid rgba(255, 170, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.download-box:hover {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.15), rgba(255, 107, 53, 0.08));
    transform: translateY(-2px);
}

.download-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--fire), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.download-info {
    flex: 1;
}

.download-name {
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
}

.download-meta {
    color: var(--white-40);
    font-size: 0.85rem;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--navy);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.modal-header h3 i {
    color: var(--gold);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--white-40);
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 1.25rem;
}

/* ========================================
   AUTH CONTAINER
   ======================================== */
.auth-container {
    display: none;
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: background 0.3s, border-color 0.3s;
}

.auth-container.active {
    display: block;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo img {
    width: 80px;
    height: 80px;
}

.auth-container h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--white-20);
    color: var(--white-60);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 70px;
        height: calc(100vh - 70px);
        z-index: 99;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 98;
    }

    .sidebar-backdrop.open {
        display: block;
    }

    .content {
        padding: 1.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .topup-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mnemonic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   THEME TOGGLE
   ======================================== */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Smooth transitions for theme changes */
*, *::before, *::after {
    transition-property: background-color, border-color, color;
    transition-duration: 0s;
}

body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after {
    transition-duration: 0.3s;
}
