/* ============================================
   Main Stylesheet - Zakynthos Directory
   ============================================ */

/* Skip link for keyboard navigation accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary, #2563eb);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    top: 0;
}

/* ============================================
   CSS Custom Properties (Theme Variables)
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;

    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
}

/* Dark mode colors - System Preference */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #60a5fa;
        --primary-dark: #3b82f6;
        --secondary: #cbd5e1;
        --dark: #f1f5f9;
        --light: #0f172a;
        --border: #475569;
        --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);

        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-gradient-start: #0f172a;
        --bg-gradient-end: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --card-bg: #1e293b;
        --card-border: #475569;
        --input-bg: #0f172a;
        --input-border: #475569;
    }
}

/* Manual dark mode override */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary: #cbd5e1;
    --dark: #f1f5f9;
    --light: #0f172a;
    --border: #475569;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --card-bg: #1e293b;
    --card-border: #475569;
    --input-bg: #0f172a;
    --input-border: #475569;
}

/* Light mode override */
[data-theme="light"] {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
}

/* ============================================
   Base Styles & Reset
   ============================================ */

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

/* Focus styles for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Remove default focus styles */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(to bottom, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Header Styles
   ============================================ */

header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   Main Content
   ============================================ */

main {
    padding: 2rem 0;
    min-height: 70vh;
}

/* ============================================
   Footer
   ============================================ */

footer {
    background: #1e293b;
    color: #f1f5f9;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    border-top: 4px solid var(--primary);
}

footer p {
    text-align: center;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ============================================
   Banner Zone
   ============================================ */

.banner-zone {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem;
    text-align: center;
    margin: 2rem 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.banner-placeholder {
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    font-size: 1.1rem;
}

/* ============================================
   Section Styles
   ============================================ */

.tag-section {
    margin: 3rem 0;
}

.tag-section h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
}

/* ============================================
   Business Grid & Cards
   ============================================ */

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.business-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

.business-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.business-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.business-card-content {
    padding: 1.5rem;
}

.business-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.business-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.business-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ============================================
   Tags
   ============================================ */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag-badge {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin: 2rem 0 1rem;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 1rem 2rem;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1rem;
    color: var(--secondary);
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    color: var(--primary);
    background: var(--light);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 2rem 0;
}

.tab-content.active {
    display: block;
}

/* Admin Subtabs */
.admin-subtab-content {
    display: none;
}

.admin-subtab-content.active {
    display: block;
}

/* ============================================
   Loading State
   ============================================ */

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--secondary);
}

/* ============================================
   Screen Reader Only
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   Dark Mode Toggle Button
   ============================================ */

.theme-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50px;
    width: 50px;
    height: 28px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 2px;
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.theme-toggle-slider {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(22px);
}

.theme-toggle-slider::before {
    content: '☀️';
}

[data-theme="dark"] .theme-toggle-slider::before {
    content: '🌙';
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    header .container {
        flex-wrap: nowrap;
    }

    header h1 {
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        transition: right 0.3s ease;
        z-index: 1000;
        border-left: 1px solid var(--border);
    }

    nav.active {
        right: 0;
    }

    nav a {
        font-size: 1rem;
        width: 100%;
        padding: 0.5rem 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .theme-toggle {
        margin-top: auto;
    }

    .container {
        padding: 0 1rem;
    }

    .tag-section h2 {
        font-size: 1.5rem;
    }

    .tabs {
        padding-bottom: 0;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .business-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
