/* CSS Design System for BeQuiet Portal
 * Style Philosophy: Space Obsidian, Translucent Glassmorphism, Liquid Emerald neon highlights
 */

:root {
    --bg-obsidian: #0b0e14;
    --card-obsidian: #0f121a;
    --emerald-primary: #10B981;
    --emerald-glow: rgba(16, 185, 129, 0.4);
    --emerald-glass: rgba(16, 185, 129, 0.04);
    --border-gray: rgba(255, 255, 255, 0.1);
    --text-primary: #cbd5e1;
    --text-secondary: #94a3b8;
    --error-red: #EF4444;
    --font-outfit: 'Outfit', sans-serif;
    --font-space: 'Space Grotesk', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-bg: rgba(8, 11, 16, 0.8);
    --input-bg: rgba(8, 11, 16, 0.5);
}

[data-theme='light'] {
    --bg-obsidian: #f8fafc;
    --card-obsidian: #ffffff;
    --emerald-primary: #059669;
    --emerald-glow: rgba(5, 150, 105, 0.2);
    --emerald-glass: rgba(5, 150, 105, 0.04);
    --border-gray: rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a; /* Near-black slate for main text */
    --text-secondary: #475569; /* High-contrast cool gray for secondary text */
    --error-red: #dc2626;
    --header-bg: rgba(248, 250, 252, 0.8);
    --input-bg: rgba(255, 255, 255, 0.8);
}

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

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: var(--font-outfit);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition), color var(--transition);
}

/* Glowing Neon Backdrop Effect */
.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    top: -10%;
    right: -10%;
    z-index: -1;
    pointer-events: none;
    transition: background var(--transition);
}

[data-theme='light'] .glow-bg {
    background: radial-gradient(circle, rgba(5, 150, 105, 0.04) 0%, rgba(0, 0, 0, 0) 70%);
}

.speaker-logo-glow {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--bg-obsidian);
    border: 4px solid var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(229, 62, 62, 0.4);
    position: relative;
    margin: 0 auto 25px auto;
    transition: background-color var(--transition), border-color var(--transition);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-space);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition);
    margin-right: 1.5rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--emerald-primary);
}

/* Header & Logo */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-gray);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition), border-color var(--transition);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-orb {
    width: 14px;
    height: 14px;
    background-color: var(--emerald-primary);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--emerald-primary);
    display: inline-block;
    animation: pulseGlow 3s infinite alternate;
}

.logo h1 {
    font-family: var(--font-space);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo h1 a {
    color: inherit;
    text-decoration: none;
}

.logo h1 span {
    color: var(--emerald-primary);
    font-weight: 400;
}

#user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Main Container */
.container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Premium Glassmorphic Cards */
.glass-card {
    background-color: var(--card-obsidian);
    border: 1px solid var(--border-gray);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 12px 40px 0 rgba(16, 185, 129, 0.05);
}

.flex-col {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Authentication Screen Specifics */
#auth-screen {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-gray);
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-space);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--emerald-primary);
    border-bottom-color: var(--emerald-primary);
}

/* Form Styles */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-group label .optional {
    text-transform: none;
    font-weight: 400;
    font-size: 0.8rem;
    color: #475569;
}

.form-group input, .form-group select, .form-group textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-family: var(--font-outfit);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s, background-color var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--emerald-primary);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-space);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--emerald-primary);
    color: var(--bg-obsidian);
    box-shadow: 0 4px 14px var(--emerald-glow);
}

.btn-primary:hover {
    background-color: #34D399;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--emerald-glow);
}

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

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Alert States */
.alert {
    border-radius: 8px;
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
    margin-top: 1rem;
    line-height: 1.4;
}

.alert.error {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.alert.success {
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #A7F3D0;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

[data-theme='light'] .description {
    color: #334155 !important; /* Extremely high contrast dark slate gray */
}

[data-theme='light'] .mock-card p.description {
    color: #1e293b !important; /* Even darker slate inside cards */
}

/* Dashboard Header elements */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    background-color: var(--emerald-glass);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-primary);
    border-radius: 50px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.badge-thanks {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* SSID Table Styling */
.zones-table-wrapper {
    flex: 1;
    overflow-x: auto;
    min-height: 180px;
    position: relative;
}

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

.zones-table th, .zones-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.zones-table th {
    font-family: var(--font-space);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.zones-table td {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.zones-table td.desc-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.zones-table .status-active {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--emerald-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.zones-table .status-active::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--emerald-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--emerald-primary);
}

.delete-zone-btn {
    background: none;
    border: none;
    color: var(--error-red);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: transform 0.1s;
}

.delete-zone-btn:hover {
    transform: scale(1.15);
}

.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    text-align: center;
    gap: 1rem;
}

.no-data-icon {
    font-size: 2rem;
    filter: opacity(0.3);
}

/* Pricing Card Mockup */
.pricing-mock {
    margin-top: auto;
    border-top: 1px solid var(--border-gray);
    padding-top: 2rem;
}

.mock-card {
    background-color: rgba(16, 185, 129, 0.02);
    border: 1px dashed var(--border-gray);
    border-radius: 12px;
    padding: 2.25rem 1.5rem 1.5rem 1.5rem; /* Extra top padding to clear absolute absolute badge */
    position: relative;
    overflow: hidden;
}

.mock-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--emerald-primary);
    letter-spacing: 0.05em;
}

.mock-card h3 {
    font-family: var(--font-space);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.mock-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.mock-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.mock-card ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.mock-card ul li {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-gray);
    padding: 2rem;
    text-align: center;
    background-color: var(--bg-obsidian);
}

.footer-container p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-container a {
    color: var(--emerald-primary);
    text-decoration: none;
}

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

/* Keyframes */
@keyframes pulseGlow {
    from {
        box-shadow: 0 0 8px var(--emerald-primary);
    }
    to {
        box-shadow: 0 0 16px var(--emerald-primary);
    }
}

/* Print Overrides for Invite QR Card */
@media print {
    body * {
        visibility: hidden;
    }
    #qr-invite-card, #qr-invite-card * {
        visibility: visible;
    }
    #qr-invite-card {
        position: absolute;
        left: 50%;
        top: 40%;
        transform: translate(-50%, -50%);
        border: 2px solid #000 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        padding: 30px !important;
    }
    #qr-invite-card div, #qr-invite-card span, #qr-invite-card p {
        color: #000000 !important;
    }
}

/* TipTap Editor Layout */
.editor-wrapper {
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.01);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-top: 0.25rem;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-gray);
}

.editor-toolbar button {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    font-family: var(--font-space);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.editor-toolbar button:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.editor-toolbar button.is-active {
    background-color: var(--emerald-glass);
    color: var(--emerald-primary);
    border-color: rgba(16, 185, 129, 0.3);
}

.editor-content-area {
    min-height: 250px;
    padding: 1rem;
    color: var(--text-primary);
    outline: none;
    overflow-y: auto;
}

.ProseMirror {
    outline: none;
    min-height: 230px;
}

.ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: var(--text-secondary);
    pointer-events: none;
    height: 0;
}

.ProseMirror img, .ProseMirror video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
}

.ProseMirror h2, .ProseMirror h3 {
    font-family: var(--font-space);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.ProseMirror ul, .ProseMirror ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.ProseMirror li {
    margin-bottom: 0.5rem;
}

.ProseMirror blockquote {
    border-left: 3px solid var(--emerald-primary);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
}

.ProseMirror pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: monospace;
    overflow-x: auto;
}

/* Blog Cover Media Containers */
.blog-media-frame {
    width: 100%;
    height: 260px;
    overflow: hidden;
    margin-bottom: 15px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition);
}

[data-theme='light'] .blog-media-frame {
    background: transparent;
    border: none;
}

.blog-reader-media-frame {
    width: 100%;
    height: 380px;
    max-height: 480px;
    overflow: hidden;
    margin-bottom: 25px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition);
}

[data-theme='light'] .blog-reader-media-frame {
    background: transparent;
    border: none;
}

