/**
 * Video Bibliotheek - CSS Styles
 * Clean white minimalist design with clear status highlights
 */

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

:root {
    /* Clean light colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --bg-card: #ffffff;
    --bg-hover: #e8eaed;

    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;

    /* Accent colors for highlights */
    --accent-primary: #1a73e8;
    --accent-hover: #1557b0;
    --accent-light: #e8f0fe;

    /* Status colors - vibrant and clear */
    --success: #1e8e3e;
    --success-bg: #e6f4ea;
    --success-border: #34a853;

    --warning: #f9ab00;
    --warning-bg: #fef7e0;
    --warning-border: #fbbc04;

    --danger: #d93025;
    --danger-bg: #fce8e6;
    --danger-border: #ea4335;

    --info: #1a73e8;
    --info-bg: #e8f0fe;
    --info-border: #4285f4;

    /* Borders & shadows */
    --border-color: #dadce0;
    --border-light: #e8eaed;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.1);
    --shadow-md: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.1);
    --shadow-lg: 0 2px 6px rgba(60, 64, 67, 0.15), 0 8px 24px rgba(60, 64, 67, 0.15);

    --transition: all 0.2s ease;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
}

html {
    font-size: 16px;
}

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

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

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

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

h3 {
    font-size: 1rem;
    font-weight: 500;
}

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

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

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875em;
    color: var(--text-secondary);
}

pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

pre code {
    background: none;
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 8px;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

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

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

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

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

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

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--font-main);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

/* Alerts - Very clear status indicators */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert::before {
    font-size: 1.1rem;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.alert-success::before {
    content: "✓";
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.alert-error::before {
    content: "✕";
}

.alert-warning {
    background: var(--warning-bg);
    color: #995c00;
    border: 1px solid var(--warning-border);
}

.alert-warning::before {
    content: "⚠";
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

/* Login Page */
.login-container {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    margin-bottom: 32px;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.login-form {
    margin-top: 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-nav {
    display: flex;
    gap: 24px;
}

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

.nav-link:hover {
    color: var(--accent-primary);
    text-decoration: none;
}

.back-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.shared-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    background: var(--info-bg);
    color: var(--info);
    border-radius: 20px;
}

/* Upload Section */
.upload-section {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.file-label:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.file-label-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.file-label-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.file-label-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Title Input */
.title-input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
}

.title-input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

/* Upload Progress - Very visible */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--info-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--info-border);
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    min-width: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-align: right;
}

.upload-message {
    min-height: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: var(--border-radius);
}

.upload-message:empty {
    display: none;
}

.upload-message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.upload-message.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* Library Section */
.library-section {
    margin-bottom: 32px;
}

.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.video-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.video-link:hover {
    text-decoration: none;
}

.video-thumbnail {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.play-icon {
    width: 56px;
    height: 56px;
    color: var(--text-muted);
    transition: var(--transition);
    background: var(--bg-primary);
    border-radius: 50%;
    padding: 14px;
    box-shadow: var(--shadow-md);
}

.video-card:hover .play-icon {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.video-info {
    padding: 16px 20px;
}

.video-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Video Page */
.video-page {
    max-width: 1000px;
    margin: 0 auto;
}

.video-player-wrapper {
    background: #000;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.video-player {
    width: 100%;
    max-height: 70vh;
    display: block;
}

.video-details {
    background: var(--bg-primary);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.video-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    word-break: break-word;
    color: var(--text-primary);
}

.video-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.video-page-meta strong {
    color: var(--text-primary);
}

/* Share Section */
.share-section {
    border-top: 1px solid var(--border-light);
    padding-top: 24px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.share-section h3 {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.share-link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.share-link-input {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.share-form {
    display: inline;
}

/* Danger Zone */
.danger-zone {
    border-top: 1px solid var(--border-light);
    padding-top: 24px;
    margin-top: 24px;
}

.danger-zone h3 {
    color: var(--danger);
    margin-bottom: 12px;
}

/* Health Check Page */
.health-page {
    max-width: 800px;
    margin: 0 auto;
}

.health-section {
    background: var(--bg-primary);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.health-section h2 {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.health-table th,
.health-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.health-table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-ok {
    color: var(--success);
    font-weight: 500;
}

.status-error {
    color: var(--danger);
    font-weight: 500;
}

.status-warning {
    color: #995c00;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    margin-left: 8px;
}

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

.badge-warning {
    background: var(--warning-bg);
    color: #995c00;
}

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

.test-result {
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.test-pass {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.test-fail {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

.help-box {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.help-box h4 {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.help-box ul {
    margin-left: 20px;
    margin-top: 12px;
}

.help-box li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.error-text {
    color: var(--danger);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
        margin-bottom: 20px;
    }

    .header-nav {
        gap: 20px;
    }

    .login-card {
        padding: 28px 24px;
    }

    .upload-section {
        padding: 24px;
    }

    .file-label {
        padding: 40px 20px;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .video-page-title {
        font-size: 1.25rem;
    }

    .video-page-meta {
        flex-direction: column;
        gap: 8px;
    }

    .share-link-box {
        flex-direction: column;
    }

    .health-section {
        padding: 20px 16px;
    }

    .health-table th,
    .health-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

/* Selection */
::selection {
    background: var(--accent-light);
    color: var(--accent-primary);
}