/* CSS Variables for theming */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --error-color: #dc2626;
    --success-color: #10b981;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-secondary);
    line-height: 1.6;
}

/* Navigation bar */
.navbar {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

.current-site {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Main content */
.main-content {
    min-height: calc(100vh - 60px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.container h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

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

.demo-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.demo-card h2 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 0;
}

.demo-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

.demo-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    align-self: flex-start;
}

.demo-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.2s;
}

.demo-link:hover {
    background-color: var(--primary-hover);
}

.no-demos {
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-align: center;
    padding: 3rem;
}

/* Demo viewer - Full-screen iframe */
#demo-iframe {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    border: none;
}

/* Fullscreen demo mode - hide navbar and expand iframe */
.demo-fullscreen .navbar {
    display: none;
}

.demo-fullscreen #demo-iframe {
    top: 0;
    height: 100vh;
}

/* Version switcher (fixed position overlay) */
.version-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    border: 1px solid var(--border-color);
}

.version-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s;
}

.version-toggle:hover {
    background-color: var(--bg-secondary);
}

.toggle-icon {
    transition: transform 0.2s;
}

.version-switcher.expanded .toggle-icon {
    transform: rotate(180deg);
}

.version-list {
    border-top: 1px solid var(--border-color);
    max-height: 300px;
    overflow-y: auto;
}

.version-list-header {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    background-color: var(--bg-secondary);
}

.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.version-item:last-child {
    border-bottom: none;
}

.version-item:hover {
    background-color: var(--bg-secondary);
}

.version-item.active {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--primary-color);
}

.current-indicator {
    color: var(--success-color);
    font-weight: bold;
}

/* Password form */
.password-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem;
}

.password-form-wrapper {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 100%;
}

.password-form-wrapper h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.site-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.password-prompt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.error-message {
    background-color: #fee2e2;
    color: var(--error-color);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.btn-submit {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .nav-brand {
        font-size: 1.25rem;
    }

    .current-site {
        font-size: 0.875rem;
    }

    .container {
        padding: 1rem;
    }

    .container h1 {
        font-size: 1.5rem;
    }

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

    .version-switcher {
        bottom: 10px;
        right: 10px;
        min-width: 180px;
    }

    .password-form-wrapper {
        padding: 1.5rem;
    }

    .password-form-wrapper h1 {
        font-size: 1.5rem;
    }
}
