/**
 * SyncVault Design System
 * Reusable CSS for all website pages
 * Version: 1.0.0
 */

/* ============================================
   CSS Variables - Design System
   ============================================ */
:root {
    /* Backgrounds */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fafafa;
    --bg-hover: #f0f0f0;
    --bg-dark: #1a1a2e;
    
    /* Text */
    --text-primary: #1a1a1a;
    --text-secondary: #5c5c5c;
    --text-muted: #8c8c8c;
    --text-inverse: #ffffff;
    
    /* Borders */
    --border: #e5e5e5;
    --border-subtle: #ebebeb;
    
    /* Accent */
    --accent: #0078d4;
    --accent-hover: #106ebe;
    --accent-light: #e6f2ff;
    
    /* Status */
    --success: #0f7b0f;
    --success-light: #e6f4e6;
    --danger: #c42b1c;
    --danger-light: #fde7e7;
    --warning: #9d5d00;
    --warning-light: #fff4e5;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 100px;
    
    /* Transitions */
    --transition: 0.15s ease;
    --transition-slow: 0.3s ease;
    
    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Cascadia Code', 'Consolas', monospace;
}

/* ============================================
   Dark Theme
   ============================================ */
[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-hover: #2a2a2a;
    --bg-dark: #000000;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    
    --border: #333333;
    --border-subtle: #2a2a2a;
    
    --accent: #60cdff;
    --accent-hover: #78d4ff;
    --accent-light: #1a3a4a;
    
    --success: #6ccb5f;
    --success-light: #1a3a1a;
    --danger: #ff99a4;
    --danger-light: #3a1a1a;
    --warning: #fce100;
    --warning-light: #3a3a1a;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

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

@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}

p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

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

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

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

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

.section-sm {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-20) 0;
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-12) 0;
    }
}

/* ============================================
   Grid System
   ============================================ */
.grid {
    display: grid;
    gap: var(--space-6);
}

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

@media (max-width: 968px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================
   Header / Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-slow), box-shadow var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}

.logo-icon img,
.logo-icon svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: var(--space-2) 0;
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

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

.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-actions .btn { display: none; }
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

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

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #a82315;
    border-color: #a82315;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
}

.card-body {
    padding: var(--space-4) 0;
}

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

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

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

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: var(--space-1);
}

.form-input.error {
    border-color: var(--danger);
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-16);
}

.section-header h2 {
    margin-bottom: var(--space-4);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ============================================
   Feature Cards
   ============================================ */
.feature-card {
    padding: var(--space-8);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    color: var(--accent);
}

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

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================================
   Pricing Cards
   ============================================ */
.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: transform var(--transition), box-shadow var(--transition);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--accent);
    position: relative;
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-full);
}

.pricing-card-header {
    text-align: center;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-6);
}

.pricing-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.pricing-card-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.pricing-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

.pricing-card-features {
    list-style: none;
    margin-bottom: var(--space-8);
}

.pricing-card-features li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-card-features li svg {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: var(--space-4);
    max-width: 280px;
}

.footer-column h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

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

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

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color var(--transition);
}

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

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-8);
    border-top: 1px solid var(--border);
}

.footer-copyright {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-social {
    display: flex;
    gap: var(--space-4);
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.footer-social a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-brand {
        grid-column: span 2;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
}

/* ============================================
   Utilities
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

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

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.transition { transition: all var(--transition); }

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn var(--transition-slow) ease; }
.animate-slide-up { animation: slideUp var(--transition-slow) ease; }
.animate-pulse { animation: pulse 2s infinite; }

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
