/* ========================================
   AirVoice API Portal - Modern Light UI
   ADHD-friendly: visual, spacious, clear
   ======================================== */

:root {
    --green: #357659;
    --green-light: #e8f5ee;
    --blue: #345C82;
    --blue-light: #e8f0f8;
    --purple: #8b5cf6;
    --purple-light: #f3f0ff;
    --orange: #f59e0b;
    --orange-light: #fef9e7;
    --red: #ef4444;
    --red-light: #fef2f2;
    --teal: #10b981;
    --teal-light: #ecfdf5;

    --bg: #f8f9fc;
    --bg-card: #ffffff;
    --bg-sidebar: #1a1a2e;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 0.2s ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fc 0%, #e8f5ee 50%, #e8f0f8 100%);
    padding: 20px;
}

.auth-container { width: 100%; max-width: 440px; }

.auth-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header { text-align: center; margin-bottom: 32px; }

.auth-logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--green), var(--teal));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.auth-logo .material-icons-round { color: #fff; font-size: 32px; }

.auth-header h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.auth-header p { color: var(--text-muted); margin-top: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.auth-footer p { color: var(--text-muted); font-size: 14px; }
.auth-footer a { color: var(--green); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ===== FORM ELEMENTS ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--text); }

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: var(--transition);
}
.input-wrapper:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(53,118,89,0.1);
}
.input-wrapper .material-icons-round { color: var(--text-light); font-size: 20px; }
.input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    outline: none;
}
.input-wrapper input::placeholder { color: var(--text-light); }

.form-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--green);
    text-decoration: none;
    margin-top: 2px;
}

.form-vertical { display: flex; flex-direction: column; gap: 16px; }
.form-vertical input:not([type="hidden"]) {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    transition: var(--transition);
}
.form-vertical input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(53,118,89,0.1);
}
.input-disabled { background: var(--bg) !important; color: var(--text-muted) !important; cursor: not-allowed; }

.inline-form { display: flex; gap: 12px; align-items: center; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    background: var(--bg);
}
.btn:hover { background: var(--border); }

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--teal));
    color: #fff;
}
.btn-primary:hover { opacity: 0.9; background: linear-gradient(135deg, var(--green), var(--teal)); transform: translateY(-1px); }

.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-sm.btn-primary { background: var(--green); }

.btn-icon { padding: 8px; border-radius: var(--radius-xs); background: none; }
.btn-icon:hover { background: var(--bg); }
.btn-icon .material-icons-round { font-size: 20px; }

.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-light); }

/* ===== ALERTS ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}
.alert .material-icons-round { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-light); color: #1a5c3a; }
.alert-success .material-icons-round { color: var(--green); }
.alert-error { background: var(--red-light); color: #991b1b; }
.alert-error .material-icons-round { color: var(--red); }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--green), var(--teal));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-icon .material-icons-round { font-size: 22px; }
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(53,118,89,0.3); color: #fff; }
.nav-item.active .material-icons-round { color: var(--teal); }
.nav-item .material-icons-round { font-size: 22px; }

.sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.nav-item.logout:hover { background: rgba(239,68,68,0.15); color: var(--red); }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; margin-left: 260px; min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }

.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text); }

.credit-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--green-light);
    color: var(--green);
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
}
.credit-badge .material-icons-round { font-size: 18px; }
.credit-label { font-weight: 500; color: #4a9e6e; }

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 100px;
    background: var(--bg);
}
.avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.user-name { font-size: 14px; font-weight: 600; }

.page-content { padding: 32px; max-width: 1200px; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; }
.page-header p { color: var(--text-muted); margin-top: 4px; }
.page-header .page-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
}
.back-link:hover { color: var(--green); }

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon .material-icons-round { font-size: 26px; }

.stat-credits .stat-icon { background: var(--green-light); color: var(--green); }
.stat-calls .stat-icon { background: var(--blue-light); color: var(--blue); }
.stat-spent .stat-icon { background: var(--orange-light); color: var(--orange); }
.stat-keys .stat-icon { background: var(--purple-light); color: var(--purple); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h2 .material-icons-round { font-size: 20px; color: var(--text-muted); }
.card-link {
    font-size: 13px;
    color: var(--green);
    text-decoration: none;
    font-weight: 600;
}
.card-link:hover { text-decoration: underline; }
.card-body { padding: 20px 24px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ===== CHARTS (Chart.js) ===== */
.chart-wrapper {
    position: relative;
    height: 240px;
}
.chart-wrapper-wide {
    height: 280px;
}
.chart-wrapper-doughnut {
    height: 280px;
}

.chart-legend-inline {
    display: flex;
    gap: 16px;
    align-items: center;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== ENDPOINT LIST ===== */
.endpoint-list { display: flex; flex-direction: column; gap: 12px; }
.endpoint-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
}
.endpoint-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.endpoint-icon .material-icons-round { font-size: 20px; }
.endpoint-info { flex: 1; }
.endpoint-info strong { font-size: 14px; display: block; }
.endpoint-info .text-muted { font-size: 13px; color: var(--text-muted); }

/* ===== ACTIVITY ===== */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-info { flex: 1; }
.activity-endpoint { font-size: 14px; font-weight: 600; display: block; }
.activity-meta { font-size: 12px; color: var(--text-muted); }
.activity-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.status-ok { background: var(--green-light); color: var(--green); }
.status-error { background: var(--red-light); color: var(--red); }
.status-dot { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .material-icons-round { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state p { margin-bottom: 8px; }

/* ===== CREATE KEY FORM ===== */
.create-key-form { display: flex; flex-direction: column; }

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(53,118,89,0.1);
}
.form-select optgroup { font-weight: 700; color: var(--text); }
.form-select option { font-weight: 400; padding: 6px; }

.endpoint-icon-sm {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.endpoint-icon-sm .material-icons-round { font-size: 16px; }

/* ===== KEYS ===== */
.keys-list { display: flex; flex-direction: column; gap: 12px; }
.key-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    gap: 16px;
}
.key-inactive { opacity: 0.5; }
.key-name { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.key-name strong { font-size: 15px; }
.key-value {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
    margin-bottom: 6px;
}
.key-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 4px; }
.key-actions { display: flex; gap: 4px; flex-shrink: 0; }
.key-display {
    display: block;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    margin-top: 8px;
    word-break: break-all;
    font-size: 13px;
    cursor: pointer;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-muted { background: var(--bg); color: var(--text-muted); }

/* ===== ENDPOINTS PAGE ===== */
.category-section { margin-bottom: 32px; }
.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.category-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.category-desc { font-size: 13px; color: var(--text-muted); }
.category-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.category-icon .material-icons-round { font-size: 22px; }
.category-header .badge { margin-left: auto; }

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}
.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: none;
    border-radius: var(--radius-xs);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.view-toggle-btn:hover { color: var(--text); background: var(--border); }
.view-toggle-btn.active { background: var(--bg-card); color: var(--green); box-shadow: var(--shadow); }
.view-toggle-btn .material-icons-round { font-size: 20px; }

/* AI Copy Buttons */
.btn-ai-copy {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: var(--font);
}
.btn-ai-copy:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ai-copy .material-icons-round { font-size: 18px; }

.btn-ai-copy-sm {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: none;
    padding: 6px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}
.btn-ai-copy-sm .material-icons-round { font-size: 16px; }
.btn-ai-copy-sm:hover { background: rgba(139, 92, 246, 0.2); }

/* View switching */
.endpoints-overview[data-view="cards"] .view-cards { display: grid; }
.endpoints-overview[data-view="cards"] .view-list { display: none; }
.endpoints-overview[data-view="list"] .view-cards { display: none; }
.endpoints-overview[data-view="list"] .view-list { display: flex; }

/* Cards View */
.endpoints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.endpoint-card-wrap {
    position: relative;
}
.endpoint-card-wrap:hover .btn-ai-copy-sm { opacity: 1; }

.endpoint-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border: 2px solid transparent;
    height: 100%;
}
.endpoint-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green);
}
.endpoint-card-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.endpoint-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.endpoint-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.endpoint-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.endpoint-url {
    display: block;
    font-size: 12px;
    color: var(--blue);
    background: var(--blue-light);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 8px;
}

.endpoint-key-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 0;
}
.endpoint-key-status .material-icons-round { font-size: 14px; }
.endpoint-key-status.has-key { color: var(--green); }
.endpoint-key-status.no-key { color: var(--text-light); text-decoration: none; }
a.endpoint-key-status.no-key:hover { color: var(--green); }

/* List View */
.endpoints-list-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.endpoint-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
}
.endpoint-list-item:hover {
    border-color: var(--green);
    box-shadow: var(--shadow);
}
.endpoint-list-item:hover .btn-ai-copy-sm { opacity: 1; }

.endpoint-list-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.endpoint-list-icon .material-icons-round { font-size: 20px; }

.endpoint-list-info { flex: 1; min-width: 0; }
.endpoint-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}
.endpoint-list-title strong { font-size: 14px; }
.endpoint-list-title code {
    font-size: 12px;
    color: var(--blue);
    background: var(--blue-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}
.endpoint-list-info p {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.endpoint-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.endpoint-list-actions {
    flex-shrink: 0;
}
.endpoint-list-actions .btn-ai-copy-sm {
    position: static;
    opacity: 0;
}
.endpoint-list-item:hover .endpoint-list-actions .btn-ai-copy-sm { opacity: 1; }

/* Copy Toast */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.copy-toast .material-icons-round { font-size: 18px; color: #8b5cf6; }

/* Credit alert overlay */
.credit-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.credit-alert-overlay.show { opacity: 1; }
.credit-alert {
    background: white;
    border-radius: 20px;
    padding: 40px 36px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.18);
    animation: creditAlertIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes creditAlertIn {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.credit-alert-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.credit-alert-icon .material-icons-round { font-size: 36px; color: #d97706; }
.credit-alert h3 {
    font-size: 1.3rem; font-weight: 700;
    color: #1a1a2e; margin: 0 0 8px;
}
.credit-alert p {
    color: #64748b; font-size: 0.95rem;
    margin: 0 0 20px; line-height: 1.5;
}
.credit-alert-balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.credit-alert-balance .material-icons-round { font-size: 18px; color: #d97706; }
.credit-alert-actions { display: flex; justify-content: center; }
.credit-alert-actions .btn { min-width: 140px; }

.method-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.method-get { background: var(--green-light); color: var(--green); }
.method-post { background: var(--blue-light); color: var(--blue); }
.method-any { background: var(--purple-light); color: var(--purple); }

.cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--orange);
}
.cost-badge .material-icons-round { font-size: 16px; }

/* ===== ENDPOINT DETAIL ===== */
.detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.detail-title-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.detail-title-icon .material-icons-round { font-size: 24px; }
.detail-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 6px;
    line-height: 1.6;
}

.detail-quick-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.quick-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}
.quick-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.quick-value {
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Docs content formatting */
.docs-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}
.docs-content li {
    list-style: none;
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
}
.docs-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}
.docs-content strong { color: var(--text); font-weight: 700; }
.inline-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--blue);
}

/* Code tabs */
.code-tab-bar {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    padding: 3px;
}
.code-tab {
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-xs);
    background: none;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.code-tab:hover { color: var(--text); }
.code-tab.active { background: var(--bg-card); color: var(--green); box-shadow: var(--shadow); }

.code-panel { display: none; }
.code-panel.active { display: block; }

/* Error codes */
.error-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}
.error-code-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    font-size: 13px;
}
.error-code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 13px;
    color: var(--red);
    background: var(--red-light);
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.detail-grid { display: flex; flex-direction: column; gap: 16px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value {
    font-size: 14px;
    background: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    word-break: break-all;
}
.detail-docs { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.detail-docs h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.detail-docs p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.code-block {
    background: #1a1a2e;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(255,255,255,0.05);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}
.code-header .btn-icon { color: rgba(255,255,255,0.5); }
.code-header .btn-icon:hover { color: #fff; background: rgba(255,255,255,0.1); }
.code-block pre {
    padding: 14px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}
.code-block code { color: #e2e8f0; font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* ===== USAGE PAGE ===== */
.usage-bar-item { margin-bottom: 16px; }
.usage-bar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}
.usage-bar-header .text-muted { margin-left: auto; font-size: 13px; }
.usage-bar-track {
    height: 8px;
    background: var(--bg);
    border-radius: 100px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
}

.text-muted { color: var(--text-muted); }

/* ===== TABLE ===== */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover { background: var(--bg); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .page-content { padding: 20px 16px; }
    .topbar { padding: 12px 16px; justify-content: space-between; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 20px; }
    .endpoints-grid { grid-template-columns: 1fr; }
    .endpoint-list-title { flex-direction: column; align-items: flex-start; gap: 4px; }
    .endpoint-list-meta { flex-wrap: wrap; gap: 6px; }
    .endpoint-list-item { flex-wrap: wrap; }
    .detail-quick-bar { flex-direction: column; }
    .detail-title-row { flex-direction: column; align-items: flex-start; }
    .code-tab-bar { flex-wrap: wrap; }
    .btn-ai-copy-sm { opacity: 1; }
    .endpoint-list-actions .btn-ai-copy-sm { opacity: 1; }
    .page-actions { flex-direction: column; gap: 8px; }
    .key-item { flex-direction: column; }
    .inline-form { flex-direction: column; }
    .form-row { flex-direction: column; }
    .auth-card { padding: 28px 20px; }
    .card-body { padding: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 22px; }
    .user-name { display: none; }
}

/* ============================================================
   SIDEBAR - Mini-Tools Section
   ============================================================ */
.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 14px;
}
.nav-section-label {
    display: block;
    padding: 4px 14px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
}

/* ============================================================
   TOOL PAGES - Layout & Components
   ============================================================ */
.tool-layout-2col {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}
.tool-panel { position: sticky; top: 80px; }

/* Form elements for tools */
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    outline: none;
    resize: vertical;
    transition: var(--transition);
}
.form-textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(53,118,89,0.1);
}

.form-range {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    outline: none;
    -webkit-appearance: none;
    margin-top: 4px;
}
.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--green);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(53,118,89,0.3);
}

.cost-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

/* Color picker */
.color-picker-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.color-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.color-btn:hover { transform: scale(1.15); }
.color-btn.active {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.color-input {
    width: 44px; height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    padding: 2px;
}
.color-hex {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

/* Style picker */
.style-picker {
    display: flex;
    gap: 10px;
}
.style-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}
.style-option input { display: none; }
.style-option:hover { border-color: var(--green); }
.style-option.active {
    border-color: var(--green);
    background: var(--green-light);
}
.style-preview {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.style-preview .material-icons-round { font-size: 24px; }

/* Size picker */
.size-picker { display: flex; gap: 8px; }
.size-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: none;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}
.size-btn:hover { border-color: var(--green); color: var(--text); }
.size-btn.active {
    border-color: var(--green);
    background: var(--green-light);
    color: var(--green);
}

/* Preview areas */
.icon-preview, .qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50%/16px 16px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    padding: 32px;
}

.icon-placeholder {
    text-align: center;
    color: var(--text-light);
}
.icon-placeholder .material-icons-round { font-size: 56px; opacity: 0.4; margin-bottom: 10px; display: block; }
.icon-placeholder p { font-size: 14px; }

.icon-result-img, .qr-result-img {
    max-width: 100%;
    border-radius: 8px;
    image-rendering: pixelated;
}

.icon-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Quick examples */
.quick-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 100px;
    background: var(--bg-card);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}
.example-chip:hover {
    border-color: var(--green);
    background: var(--green-light);
    transform: translateY(-1px);
}
.example-chip .material-icons-round { font-size: 18px; }

/* Model info badges */
.model-info {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.model-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--orange-light);
    color: var(--orange);
    font-size: 12px;
    font-weight: 700;
}
.model-vision-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--purple-light);
    color: var(--purple);
    font-size: 12px;
    font-weight: 700;
}
.model-vision-badge .material-icons-round { font-size: 14px; }

.search-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   CHAT INTERFACE
   ============================================================ */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}
.chat-settings { position: sticky; top: 80px; }

.chat-area {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
}
.chat-area .card-body { display: none; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}
.chat-welcome-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-light), var(--blue-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.chat-welcome-icon .material-icons-round { font-size: 32px; color: var(--green); }
.chat-welcome h3 { font-size: 18px; color: var(--text); margin-bottom: 4px; }
.chat-welcome p { font-size: 14px; max-width: 400px; }

.chat-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 85%;
    animation: chatFadeIn 0.3s ease;
}
@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-assistant { align-self: flex-start; }

.chat-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-avatar .material-icons-round { font-size: 18px; color: #fff; }
.chat-avatar-user { background: linear-gradient(135deg, var(--blue), var(--purple)); }
.chat-avatar-assistant { background: linear-gradient(135deg, var(--green), var(--teal)); }

.chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-msg-user .chat-bubble {
    background: linear-gradient(135deg, var(--green), var(--teal));
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg-assistant .chat-bubble {
    background: var(--bg);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat-msg-meta {
    font-size: 11px;
    color: var(--text-light);
    align-self: flex-end;
    flex-shrink: 0;
}

.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 24px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    outline: none;
    resize: none;
    max-height: 120px;
    transition: var(--transition);
    background: var(--bg);
}
.chat-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53,118,89,0.1); }

.chat-send-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-send-btn .material-icons-round { font-size: 20px; }

.chat-input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
}

/* ============================================================
   GEOIP RESULTS
   ============================================================ */
.geoip-result-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.geoip-map {
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 200px;
}
.geoip-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.geoip-details { display: flex; flex-direction: column; gap: 12px; }
.geoip-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-xs);
}
.geoip-row .material-icons-round {
    font-size: 20px;
    color: var(--green);
    margin-top: 2px;
    flex-shrink: 0;
}
.geoip-row strong { display: block; font-size: 13px; }
.geoip-row div { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* ============================================================
   LANDEN EXPLORER
   ============================================================ */
.landen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.land-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.land-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.land-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}
.land-card-flag { font-size: 48px; line-height: 1; flex-shrink: 0; }
.land-card-title { flex: 1; min-width: 0; }
.land-card-title h3 { font-size: 17px; font-weight: 700; margin: 0 0 2px; color: var(--text-primary); }
.land-card-native { font-size: 13px; color: var(--text-muted); }
.land-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-color);
    border-top: 1px solid var(--border-color);
}
.land-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text-secondary);
}
.land-stat .material-icons-round { font-size: 16px; color: var(--text-muted); }
.land-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-page);
}

/* Detail Overlay */
.land-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.land-detail-overlay.show { opacity: 1; }
.land-detail-panel {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    animation: landDetailIn 0.35s cubic-bezier(0.34,1.4,0.64,1);
}
@keyframes landDetailIn {
    from { transform: scale(0.92) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.land-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: var(--transition);
}
.land-detail-close:hover { background: white; transform: scale(1.1); }
.land-detail-close .material-icons-round { font-size: 20px; color: var(--text-muted); }

/* Detail Hero */
.land-detail-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 28px 20px;
}
.land-detail-flag { font-size: 72px; line-height: 1; }
.land-detail-hero-text h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 2px;
    color: var(--text-primary);
}
.land-detail-native { font-size: 15px; color: var(--text-muted); display: block; margin-bottom: 10px; }
.land-detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.land-detail-badges .badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Detail Map */
.land-detail-map {
    margin: 0 20px 20px;
    border-radius: 14px;
    overflow: hidden;
    height: 250px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.land-detail-map iframe { width: 100%; height: 100%; border: none; }

/* Detail Stats Grid */
.land-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: var(--border-color);
    border-top: 1px solid var(--border-color);
}
.land-detail-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
}
.land-detail-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.land-detail-stat-icon .material-icons-round { font-size: 20px; }
.land-detail-stat-info { min-width: 0; }
.land-detail-stat-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 2px; }
.land-detail-stat-value { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.land-detail-stat-sub { display: block; font-size: 12px; color: var(--text-muted); }

/* Detail Coords */
.land-detail-coords {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-page);
}

@media (max-width: 600px) {
    .landen-grid { grid-template-columns: 1fr; }
    .land-detail-overlay { padding: 16px 8px; }
    .land-detail-hero { flex-direction: column; text-align: center; gap: 12px; padding: 24px 20px 16px; }
    .land-detail-badges { justify-content: center; }
    .land-detail-grid { grid-template-columns: 1fr; }
    .land-detail-flag { font-size: 56px; }
    .land-detail-map { height: 200px; margin: 0 12px 12px; }
}

/* ============================================================
   FUN LOADING SPINNER
   ============================================================ */
.fun-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 16px;
    text-align: center;
}
.fun-loader-lg { padding: 48px 16px; }

/* Bouncing dots */
.fun-loader-dots {
    display: flex;
    gap: 6px;
}
.fun-loader-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: funBounce 1.4s ease-in-out infinite;
}
.fun-loader-dots span:nth-child(1) {
    background: var(--green);
    animation-delay: 0s;
}
.fun-loader-dots span:nth-child(2) {
    background: var(--purple);
    animation-delay: 0.16s;
}
.fun-loader-dots span:nth-child(3) {
    background: var(--orange);
    animation-delay: 0.32s;
}

@keyframes funBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* Magic orb (for icon generator) */
.fun-loader-animation {
    position: relative;
    width: 80px;
    height: 80px;
}
.magic-orb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--purple), var(--orange));
    background-size: 300% 300%;
    animation: orbGlow 2s ease-in-out infinite, orbSpin 3s linear infinite;
    position: absolute;
    top: 10px; left: 10px;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(53, 118, 89, 0.2);
}

@keyframes orbGlow {
    0%, 100% { background-position: 0% 50%; transform: scale(1); }
    50% { background-position: 100% 50%; transform: scale(1.1); }
}
@keyframes orbSpin {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

/* Sparkles around orb */
.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: sparkleFloat 2s ease-in-out infinite;
}
.sparkle.s1 { background: var(--orange); top: 0; left: 36px; animation-delay: 0s; }
.sparkle.s2 { background: var(--green); top: 36px; right: 0; animation-delay: 0.5s; }
.sparkle.s3 { background: var(--purple); bottom: 0; left: 36px; animation-delay: 1s; }
.sparkle.s4 { background: var(--blue); top: 36px; left: 0; animation-delay: 1.5s; }

@keyframes sparkleFloat {
    0%, 100% { transform: scale(0.4) translateY(0); opacity: 0.3; }
    50% { transform: scale(1.2) translateY(-8px); opacity: 1; }
}

/* Fun text */
.fun-loader-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-height: 24px;
    animation: textFade 0.4s ease;
}
@keyframes textFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE - TOOLS
   ============================================================ */
@media (max-width: 1024px) {
    .tool-layout-2col { grid-template-columns: 1fr; }
    .tool-panel { position: static; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-settings { position: static; }
    .chat-area { height: auto; min-height: 500px; }
}

@media (max-width: 768px) {
    .style-picker { flex-direction: column; }
    .color-picker-row { gap: 6px; }
    .color-btn { width: 32px; height: 32px; }
    .icon-preview, .qr-preview { min-height: 200px; padding: 20px; }
    .chat-messages { padding: 16px; }
    .chat-input-area { padding: 12px 16px; }
    .chat-msg { max-width: 95%; }
}

/* ============================================================
   SMS TOOL
   ============================================================ */
.sms-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.sms-sender-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #10b98110;
    border: 1px solid #10b98130;
    border-radius: 8px;
    font-size: 13px;
    color: #10b981;
    margin-bottom: 20px;
}
.sms-sender-info .material-icons-round { font-size: 18px; }

.sms-textarea {
    min-height: 100px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.5;
}

.sms-char-info {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.sms-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}
.sms-alert-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.sms-alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.sms-alert .material-icons-round { font-size: 18px; }

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

/* SMS History */
.sms-history-section {
    margin-bottom: 20px;
}
.sms-history-section h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sms-history-section h3 .material-icons-round { font-size: 16px; }

.sms-history-item {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-page);
    transition: border-color 0.15s;
}
.sms-history-item:hover { border-color: var(--border-dark, #c0c0c0); }

.sms-history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.sms-history-meta .material-icons-round {
    font-size: 16px;
    color: var(--text-muted);
}
.sms-history-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}
.sms-history-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.sms-history-pending { border-left: 3px solid #3b82f6; }
.sms-history-ok { border-left: 3px solid #10b981; }
.sms-history-error { border-left: 3px solid #ef4444; }

/* Unverified state */
.sms-unverified-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f59e0b15;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.sms-unverified-icon .material-icons-round {
    font-size: 40px;
    color: #f59e0b;
}

/* Phone verification (profile page) */
.phone-verified-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #10b98108;
    border: 1px solid #10b98125;
    border-radius: 10px;
}
.phone-verified-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #10b98115;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.phone-verified-icon .material-icons-round {
    font-size: 28px;
    color: #10b981;
}

/* OTP Digit Boxes */
.otp-digits {
    display: flex;
    gap: 10px;
}
.otp-digit {
    width: 52px;
    height: 60px;
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-page);
    outline: none;
    transition: all 0.2s ease;
    caret-color: var(--primary);
}
.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(53, 118, 89, 0.15);
    background: #fff;
}
.otp-digit.otp-success {
    border-color: #10b981;
    background: #ecfdf5;
    color: #10b981;
    animation: otpPop 0.3s ease;
}
.otp-digit.otp-error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
    animation: otpShake 0.4s ease;
}
.otp-digit.otp-checking {
    border-color: var(--primary);
    opacity: 0.6;
}
@keyframes otpPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.phone-code-sent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #3b82f610;
    border: 1px solid #3b82f630;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6;
}
.phone-code-sent .material-icons-round { font-size: 18px; }

.phone-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .sms-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .phone-verified-info { flex-direction: column; text-align: center; }
}
