/*
 * Bezalel Design Lab - Main Stylesheet
 * Identity: Engineering precision, trust, artistry.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Poppins:wght@500;600;700&display=swap');

:root {
    /* Brand Colors */
    --color-primary: #1E3A5F;
    --color-primary-light: #2D5F9E;
    --color-primary-dark: #142842;
    --color-accent: #00C9FF;
    --color-accent-hover: #00A3D1;

    /* Neutrals */
    --color-surface: #F8FAFC;
    --color-surface-card: #FFFFFF;
    --color-text: #1A2332;
    --color-text-muted: #6B7C93;
    --color-border: #E2E8F0;

    /* Status */
    --color-success: #10B981;
    --color-success-bg: #ECFDF5;
    --color-error: #EF4444;
    --color-error-bg: #FEF2F2;
    --color-warning: #F59E0B;
    --color-warning-bg: #FFFBEB;
    --color-info: #3B82F6;
    --color-info-bg: #EFF6FF;

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 100px;
    --sidebar-width: 240px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-surface);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-primary-light); }

code, pre { font-family: 'JetBrains Mono', monospace; }

img { max-width: 100%; height: auto; }

.main-content { flex: 1; }

/* ==================== Utilities ==================== */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.875rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1rem;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }

.btn-primary { background-color: var(--color-primary); color: white; }
.btn-primary:hover { background-color: var(--color-primary-light); color: white; transform: translateY(-1px); }

.btn-accent { background-color: var(--color-accent); color: var(--color-primary-dark); }
.btn-accent:hover { background-color: var(--color-accent-hover); color: var(--color-primary-dark); transform: translateY(-1px); }

.btn-outline { background-color: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background-color: var(--color-primary); color: white; }

.btn-danger { background-color: var(--color-error); color: white; }
.btn-danger:hover { background-color: #DC2626; color: white; }

.btn-success { background-color: var(--color-success); color: white; }

/* ==================== Alerts / Flash Messages ==================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-success { background-color: var(--color-success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background-color: var(--color-error-bg); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background-color: var(--color-warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background-color: var(--color-info-bg); color: #1E40AF; border: 1px solid #BFDBFE; }

.error-list { list-style: none; padding: 0; }
.error-list li { padding: 0.5rem 1rem; background: var(--color-error-bg); color: #991B1B; border: 1px solid #FECACA; border-radius: var(--radius-sm); margin-bottom: 0.5rem; font-size: 0.9rem; }

/* ==================== Forms ==================== */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 201, 255, 0.15);
}

.form-textarea { resize: vertical; min-height: 120px; }

.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--color-primary); }

/* Auth form wrapper */
.auth-container {
    max-width: 480px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.auth-container h1 { text-align: center; margin-bottom: 0.5rem; }
.auth-container .auth-subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 2rem; }

/* ==================== Cards ==================== */
.card {
    background: var(--color-surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-static:hover { transform: none; box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 0.75rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

/* Product Cards */
.product-card { text-align: center; padding: 2.5rem 2rem; }
.product-card .price { font-size: 2rem; font-weight: 700; color: var(--color-primary); margin: 1rem 0; }
.product-card .price span { font-size: 1rem; font-weight: 400; color: var(--color-text-muted); }
.product-card .feature-list { list-style: none; padding: 0; margin: 1.5rem 0; text-align: left; }
.product-card .feature-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); color: var(--color-text-muted); }
.product-card .feature-list li::before { content: "\2713 "; color: var(--color-success); font-weight: 700; margin-right: 0.5rem; }

/* Pricing Toggle */
.pricing-toggle {
    display: inline-flex;
    background: var(--color-border);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 2rem;
}
.pricing-toggle button {
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.pricing-toggle button.active {
    background: var(--color-primary);
    color: white;
}

/* Stat Cards */
.stat-card { text-align: center; }
.stat-card .stat-value { font-size: 2.5rem; font-weight: 700; color: var(--color-primary); }
.stat-card .stat-label { color: var(--color-text-muted); font-size: 0.9rem; }

/* ==================== Tables ==================== */
.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background-color: var(--color-surface);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table tbody tr:hover { background-color: #F1F5F9; }

/* ==================== Badges / Status ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-active { background-color: var(--color-success-bg); color: #065F46; }
.badge-expired { background-color: var(--color-error-bg); color: #991B1B; }
.badge-suspended { background-color: var(--color-warning-bg); color: #92400E; }
.badge-pending { background-color: var(--color-info-bg); color: #1E40AF; }
.badge-open { background-color: var(--color-info-bg); color: #1E40AF; }
.badge-closed { background-color: var(--color-surface); color: var(--color-text-muted); }

/* ==================== Navigation ==================== */
.navbar {
    background-color: white;
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand img { height: 80px; width: auto; }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-link { font-weight: 500; color: var(--color-text); }
.nav-link:hover { color: var(--color-accent); }
.nav-auth { display: flex; gap: 1rem; align-items: center; }

/* Nav Dropdowns */
.nav-dropdown { position: relative; }
.nav-dropdown > .nav-link { cursor: pointer; }
.nav-dropdown > .nav-link::after { content: ' \25BE'; font-size: 0.7em; opacity: 0.6; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 100;
    margin-top: 0.25rem;
}
.nav-dropdown:hover > .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--color-surface); color: var(--color-accent); }

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: 0.3s;
}

/* ==================== Hero ==================== */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero h1 { color: white; font-size: 3rem; margin-bottom: 1.5rem; }
.hero p { font-size: 1.25rem; color: rgba(255, 255, 255, 0.9); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ==================== Sections ==================== */
.section { padding: 4rem 0; }
.section-alt { background-color: white; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { color: var(--color-text-muted); max-width: 600px; margin: 0 auto; }

/* ==================== Dashboard Layout ==================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    min-height: 60vh;
}

.dashboard-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    font-weight: 700;
    padding: 1rem 0.75rem 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.sidebar-link:hover { background-color: var(--color-surface); color: var(--color-primary); }
.sidebar-link.active { background-color: var(--color-primary); color: white; }
.sidebar-link.active:hover { color: white; }

.dashboard-main { min-width: 0; }

/* ==================== License Key Display ==================== */
.license-key {
    font-family: 'JetBrains Mono', monospace;
    background: var(--color-surface);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.license-key .key-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==================== Page Header ==================== */
.page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 3rem 0;
}
.page-header h1 { color: white; margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.8); }

/* Breadcrumb */
.breadcrumb { display: flex; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb span { color: var(--color-text-muted); }

/* ==================== Ticket / Message Thread ==================== */
.message-thread { display: flex; flex-direction: column; gap: 1rem; }
.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    max-width: 80%;
}
.message-bubble.user { background: var(--color-surface); align-self: flex-start; }
.message-bubble.admin { background: var(--color-info-bg); align-self: flex-end; }
.message-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.5rem; }

/* ==================== Footer ==================== */
.footer {
    background-color: var(--color-primary-dark);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr; gap: 2rem; margin-bottom: 3rem; }
.footer h4 { color: white; margin-bottom: 1.5rem; }
.footer a { color: rgba(255, 255, 255, 0.7); display: block; margin-bottom: 0.75rem; }
.footer a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 2rem; text-align: center; color: rgba(255, 255, 255, 0.5); font-size: 0.875rem; }

/* Newsletter Form */
.newsletter-input-group { display: flex; gap: 0.5rem; }
.newsletter-input-group input[type="email"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
}
.newsletter-input-group input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.5); }
.newsletter-input-group input[type="email"]:focus { outline: none; border-color: var(--color-accent); }

/* ==================== Search ==================== */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.search-bar .form-input { flex: 1; }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: white; padding: 1rem; box-shadow: var(--shadow-md); gap: 0; z-index: 100; }
    .nav-links.open li { padding: 0.75rem 0; }
    .nav-toggle { display: block; }
    .nav-dropdown-menu { position: static; transform: none; box-shadow: none; border: none; padding: 0 0 0 1rem; margin-top: 0; }
    .nav-dropdown > .nav-link::after { display: none; }
    .nav-links.open .nav-dropdown-menu { display: block; }
    .nav-auth .btn { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
    .hero h1 { font-size: 2rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .footer-grid { grid-template-columns: 1fr; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { position: static; }
    .form-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .auth-container { margin: 1rem; padding: 1.5rem; }
}
