/**
 * DigiStock - Main Stylesheet
 * Modern SaaS Design - Dark Theme
 * Black & White Premium Aesthetic
 */

/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    /* Colors */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: #0f0f0f;
    --bg-card-hover: #1a1a1a;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --border-primary: #333333;
    --border-secondary: #222222;
    --border-accent: #444444;
    
    --accent: #ffffff;
    --accent-hover: #e0e0e0;
    
    /* Glassmorphism */
    --glass-bg: rgba(15, 15, 15, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-secondary);
}

/* ========================================
   Layout
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: 800px;
}

.container-lg {
    max-width: 1400px;
}

.section {
    padding: var(--space-3xl) 0;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

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

.flex {
    display: flex;
    gap: var(--space-md);
}

.flex-wrap { flex-wrap: wrap; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-col { flex-direction: column; }

/* ========================================
   Components - Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-xl);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    gap: var(--space-sm);
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-lg {
    padding: var(--space-md) var(--space-2xl);
    font-size: 1rem;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* ========================================
   Components - Cards
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-secondary);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.card-body {
    flex: 1;
}

.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-secondary);
}

/* ========================================
   Components - Forms
   ======================================== */
.form {
    max-width: 500px;
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: var(--space-md);
    font-size: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

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

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    background-size: 1rem;
    padding-right: var(--space-3xl);
}

[dir="rtl"] select.form-control {
    background-position: left var(--space-md) center;
    padding-right: var(--space-md);
    padding-left: var(--space-3xl);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--accent);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   Components - Navbar
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-secondary);
    padding: var(--space-md) 0;
    transition: all var(--transition-base);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    list-style: none;
}

.navbar-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.navbar-link:hover,
.navbar-link.active {
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-switcher select {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.navbar-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* ========================================
   Components - Footer
   ======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-secondary);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2xl);
}

.footer-brand {
    grid-column: span 1;
}

.footer-brand img {
    height: 40px;
    width: auto;
    margin-bottom: var(--space-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.footer-bottom p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* ========================================
   Components - Tables
   ======================================== */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

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

.table th,
.table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Components - Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

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

.badge-info {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ========================================
   Components - Alerts
   ======================================== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
    color: #facc15;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* ========================================
   Components - Loading
   ======================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Dashboard Layout
   ======================================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.dashboard-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-secondary);
    padding: var(--space-xl);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

[dir="rtl"] .dashboard-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-secondary);
}

.dashboard-content {
    padding: var(--space-2xl);
}

.dashboard-nav {
    list-style: none;
}

.dashboard-nav li {
    margin-bottom: var(--space-sm);
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dashboard-nav a svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    padding-top: 120px;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--space-2xl);
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Download page — latest installer
   ======================================== */
.download-latest-card {
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.download-latest-card .card-body {
    padding: var(--space-2xl) var(--space-xl);
}

.download-latest-status {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.download-latest-version {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
}

.download-latest-version strong {
    color: var(--text-primary);
    font-weight: 700;
}

.download-latest-notes {
    max-width: 36rem;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.download-latest-btn {
    min-width: 16rem;
}

.download-latest-error {
    margin-top: var(--space-md);
}

/* ========================================
   Features Section
   ======================================== */
.feature-card {
    text-align: center;
    padding: var(--space-2xl);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   Pricing Section
   ======================================== */
.pricing-card {
    text-align: center;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: var(--shadow-xl);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-primary);
    padding: var(--space-xs) var(--space-md);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 700;
    margin: var(--space-lg) 0;
}

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

.pricing-features {
    list-style: none;
    text-align: left;
    margin: var(--space-xl) 0;
}

.pricing-features li {
    padding: var(--space-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-secondary);
}

.pricing-features li svg {
    width: 20px;
    height: 20px;
    color: #4ade80;
    flex-shrink: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { display: none; }
    
    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-secondary);
        flex-direction: column;
        padding: var(--space-lg);
    }
    
    .navbar-nav.active {
        display: flex;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .section {
        padding: var(--space-2xl) 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    h1 { font-size: 2rem; }
    
    .btn {
        width: 100%;
    }
    
    .hero-actions {
        flex-direction: column;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-fade-in {
    animation: fadeIn var(--transition-slow);
}

.animate-slide-up {
    animation: slideUp var(--transition-slow);
}

.animate-slide-down {
    animation: slideDown var(--transition-slow);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .navbar,
    .footer,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
