/* ===================================
   GuruFrame Portal — Shared Styles
   Matches main site: Dark bg, Red accent, Inter font
   =================================== */

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

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

:root {
    --bg-dark: #1a1a2e;
    --bg-darker: #12121f;
    --bg-card: #222240;
    --bg-input: #2a2a48;
    --red: #e63946;
    --red-dark: #c1121f;
    --red-glow: rgba(230, 57, 70, 0.3);
    --green: #2ecc71;
    --green-dim: rgba(46, 204, 113, 0.15);
    --yellow: #f1c40f;
    --yellow-dim: rgba(241, 196, 15, 0.15);
    --blue: #3498db;
    --blue-dim: rgba(52, 152, 219, 0.15);
    --orange: #e67e22;
    --orange-dim: rgba(230, 126, 34, 0.15);
    --white: #ffffff;
    --gray-light: #b8b8d0;
    --gray: #6e6e8a;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --sidebar-width: 260px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===================================
   Auth Pages (Login / Signup)
   =================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: radial-gradient(ellipse at center top, rgba(230, 57, 70, 0.06) 0%, transparent 60%);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-logo {
    display: block;
    width: 180px;
    height: auto;
    margin: 0 auto 8px;
    filter: drop-shadow(0 4px 20px rgba(230, 57, 70, 0.2));
}

.auth-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--gray-light);
    font-size: 14px;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--white);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-group input::placeholder {
    color: var(--gray);
}

.form-group input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
    cursor: pointer;
}

.form-checkbox label {
    font-size: 13px;
    color: var(--gray-light);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 20px var(--red-glow);
}

.btn-primary:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 30px var(--red-glow);
}

.btn-full {
    width: 100%;
    text-align: center;
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-outline-red {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-outline-red:hover {
    background: var(--red);
    color: var(--white);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray);
}

.auth-footer a {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.password-strength {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

/* ===================================
   Dashboard Layout
   =================================== */

.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-logo img {
    height: 45px;
    width: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 0 12px;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.sidebar-nav a.active {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 15px var(--red-glow);
}

.sidebar-nav .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray);
    padding: 20px 28px 8px;
    font-weight: 600;
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-darker);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    flex: 1;
}

.user-info .user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-info .user-plan {
    font-size: 11px;
    color: var(--gray);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.page-header .header-date {
    color: var(--gray);
    font-size: 14px;
}

/* ===================================
   Stat Cards
   =================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.3s;
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 6px;
}

.stat-change.up {
    color: var(--green);
}

.stat-change.down {
    color: var(--red);
}

/* ===================================
   Cards & Panels
   =================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 24px;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ===================================
   Token Usage Chart (CSS-only bars)
   =================================== */

.usage-bar-group {
    margin-bottom: 18px;
}

.usage-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.usage-bar-label span:first-child {
    font-weight: 600;
}

.usage-bar-label span:last-child {
    color: var(--gray-light);
}

.usage-bar {
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease;
}

.usage-bar-fill.claude { background: var(--red); }
.usage-bar-fill.grok { background: var(--blue); }
.usage-bar-fill.llama { background: var(--green); }
.usage-bar-fill.copilot { background: var(--orange); }

/* ===================================
   Model Cards (Marketplace)
   =================================== */

.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.model-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    transition: border-color 0.3s, transform 0.2s;
    position: relative;
}

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

.model-card.active {
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.1);
}

.model-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.model-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.model-card .model-desc {
    font-size: 13px;
    color: var(--gray-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.model-card .model-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
    margin-bottom: 14px;
}

.model-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-status.enabled {
    background: var(--green-dim);
    color: var(--green);
}

.model-status.available {
    background: var(--blue-dim);
    color: var(--blue);
}

.model-status.pending {
    background: var(--yellow-dim);
    color: var(--yellow);
}

/* ===================================
   Device List
   =================================== */

.device-list {
    list-style: none;
}

.device-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.device-item:last-child {
    border-bottom: none;
}

.device-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-input);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.device-info {
    flex: 1;
}

.device-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.device-info p {
    font-size: 12px;
    color: var(--gray);
}

.device-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.device-status.online {
    background: var(--green-dim);
    color: var(--green);
}

.device-status.offline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gray);
}

/* ===================================
   Tables (Admin)
   =================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

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

.client-name {
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: var(--green-dim);
    color: var(--green);
}

.status-badge.pending {
    background: var(--yellow-dim);
    color: var(--yellow);
}

.status-badge.inactive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gray);
}

/* ===================================
   Request Queue (Admin)
   =================================== */

.request-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.request-type {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.request-type.model {
    background: var(--blue-dim);
    color: var(--blue);
}

.request-type.device {
    background: var(--orange-dim);
    color: var(--orange);
}

.request-info {
    flex: 1;
}

.request-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.request-info p {
    font-size: 12px;
    color: var(--gray);
}

.request-actions {
    display: flex;
    gap: 8px;
}

.btn-approve {
    background: var(--green);
    color: var(--white);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-approve:hover { opacity: 0.85; }

.btn-deny {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gray-light);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-deny:hover { background: rgba(255, 255, 255, 0.12); }

/* ===================================
   Billing Section
   =================================== */

.billing-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.billing-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.billing-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 16px;
}

.billing-item .billing-label {
    color: var(--gray-light);
}

/* ===================================
   Alerts & Notifications
   =================================== */

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-info {
    background: var(--blue-dim);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: var(--blue);
}

.alert-success {
    background: var(--green-dim);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--green);
}

.alert-warning {
    background: var(--yellow-dim);
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: var(--yellow);
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .models-grid {
        grid-template-columns: 1fr;
    }
    .auth-card {
        padding: 32px 24px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .billing-summary {
        grid-template-columns: 1fr;
    }
}
