/* ClutchClip - Main Stylesheet */

/* CSS Variables */
:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-text: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-border: #334155;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

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

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

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main.container {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Header & Navigation */
header {
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer */
.footer {
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: 1rem;
    text-align: center;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
}

.btn-copy,
.btn-copy-link,
.btn-share {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-copy:hover,
.btn-copy-link:hover,
.btn-share:hover {
    background-color: var(--color-border);
}

.btn-remove {
    background-color: var(--color-error);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-remove:hover {
    background-color: #dc2626;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-info {
    background-color: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--color-text);
}

.alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.alert-error .alert-icon {
    background-color: var(--color-error);
    color: white;
}

.alert-success .alert-icon {
    background-color: var(--color-success);
    color: white;
}

.success-content {
    flex: 1;
}

.share-url-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.share-url-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-size: 0.875rem;
}

/* Upload Page */
.upload-page {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.upload-page h1 {
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    background-color: var(--color-bg-secondary);
    position: relative;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--color-primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.dropzone.has-file {
    border-color: var(--color-success);
    border-style: solid;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.dropzone-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.dropzone-subtext {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.dropzone-info {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.file-info.hidden {
    display: none;
}

#fileName {
    font-weight: 500;
    word-break: break-all;
}

#fileSize {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* Progress */
.progress-container {
    margin-top: 1.5rem;
}

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

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    width: 0%;
    transition: width var(--transition-fast);
}

.progress-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Upload Button */
.btn-upload {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 1.125rem;
}

/* Watch Page */
.watch-page {
    max-width: 960px;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    width: 100%;
    background-color: black;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-player {
    width: 100%;
    display: block;
    max-height: 70vh;
    object-fit: contain;
    background-color: black;
}

.video-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.view-count,
.duration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.share-section {
    display: flex;
    gap: 0.5rem;
}

/* Game Tagging */
.game-tag-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.game-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 16px;
    color: #a5b4fc;
    font-size: 0.875rem;
    font-weight: 500;
}

.game-badge svg {
    opacity: 0.8;
}

.btn-tag-game {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tag-game:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.game-selector {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    max-height: 280px;
    overflow: hidden;
    z-index: 100;
}

.game-search-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-bg-tertiary);
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.875rem;
    outline: none;
}

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

.game-list {
    max-height: 200px;
    overflow-y: auto;
}

.game-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.game-option:hover {
    background: var(--color-bg-tertiary);
}

.game-option-icon {
    width: 32px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.game-option-icon-placeholder {
    width: 32px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 2px;
    flex-shrink: 0;
}

.game-option-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-option-empty {
    padding: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.game-badge-icon {
    width: 24px;
    height: 9px;
    object-fit: cover;
    border-radius: 2px;
}

.game-badge-icon-placeholder {
    width: 24px;
    height: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 0.5rem;
    font-weight: 600;
    border-radius: 2px;
}

/* Games Browse Page */
.games-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.games-page h1 {
    margin-bottom: 0.5rem;
}

.games-page .subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

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

.game-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.game-card:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.game-icon {
    width: 92px;
    height: 35px;
    flex-shrink: 0;
}

.game-icon img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.game-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), #8b2b1a);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
}

.game-info {
    min-width: 0;
}

.game-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-clip-count {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Game Feed Page */
.game-feed-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.game-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

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

.game-header h1 {
    margin: 0.5rem 0 0.25rem 0;
}

.game-header .clip-count {
    color: var(--color-text-muted);
    margin: 0;
}

/* Trending Page */
.trending-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.trending-header {
    margin-bottom: 2rem;
}

.trending-header h1 {
    margin: 0 0 0.25rem 0;
}

.trending-header .subtitle {
    color: var(--color-text-muted);
    margin: 0;
}

/* Video Game Tag Overlay (on thumbnails) */
.video-game-tag {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    max-width: calc(100% - 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Reactions */
.reactions-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e0e0e0;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.reaction-btn.active {
    background: rgba(205, 65, 43, 0.3);
    border-color: #cd412b;
}

.reaction-emoji {
    font-size: 1.25rem;
    line-height: 1;
}

.reaction-count {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 1rem;
    text-align: center;
}

/* Error Container */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}

.error-icon {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.error-container h2 {
    color: var(--color-text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

/* Error Page */
.error-page {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
}

.error-content {
    margin-top: 2rem;
}

/* Video Player Partial */
.video-player-container {
    width: 100%;
}

.video-info {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* Processing State */
.processing-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: var(--color-bg-secondary);
}

.processing-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.processing-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px) brightness(0.5);
}

.processing-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-tertiary));
}

.processing-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
}

.processing-content {
    text-align: center;
    padding: 2rem;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-bg-tertiary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.processing-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.processing-progress-bar {
    width: 200px;
    height: 8px;
    background-color: var(--color-bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 0.5rem;
}

.processing-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    transition: width 0.3s ease;
}

.processing-percent {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary-light);
}

/* Trim Button Toggle */
.btn-trim-toggle {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-trim-toggle:hover {
    background-color: var(--color-border);
}

.btn-trim-toggle.active {
    background-color: var(--color-primary);
    color: white;
}

.btn-trim-toggle.active:hover {
    background-color: var(--color-primary-dark);
}

/* Trim Overlay - positioned on video */
.trim-overlay {
    position: absolute;
    bottom: 50px; /* Just above native video controls */
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    z-index: 10;
}

.trim-overlay .trim-track {
    position: relative;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin: 0 12px; /* Space for handles at edges */
}

.trim-overlay .trim-selection {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 3px;
    pointer-events: none;
}

.trim-overlay .trim-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: grab;
    z-index: 10;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.trim-overlay .trim-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.trim-overlay .trim-handle:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.trim-overlay .trim-handle.trim-start {
    background-color: var(--color-success);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.trim-overlay .trim-handle.trim-end {
    background-color: var(--color-error);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.trim-time-display {
    text-align: center;
    margin-top: 0.5rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.trim-overlay .trim-error {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(239, 68, 68, 0.85);
    border-radius: var(--border-radius);
    color: white;
    font-size: 0.75rem;
    text-align: center;
}

/* Custom Video Controls (for trim mode) */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    z-index: 20;
}

.ctrl-play-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.ctrl-play-pause:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.ctrl-play-pause:active {
    transform: scale(0.95);
}

.ctrl-play-pause svg {
    width: 20px;
    height: 20px;
}

.ctrl-timeline {
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
}

.ctrl-progress-bg {
    position: relative;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 0 8px; /* Space for handles */
}

.ctrl-progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
}

.ctrl-trim-selection {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 3px;
    pointer-events: none;
    z-index: 2;
}

.ctrl-playhead {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 16px;
    background-color: white;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 5;
}

.ctrl-trim-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: grab;
    z-index: 10;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.ctrl-trim-handle:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.ctrl-trim-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.ctrl-trim-handle.start {
    background-color: var(--color-success);
}

.ctrl-trim-handle.end {
    background-color: var(--color-error);
}

.ctrl-time {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-page {
        padding: 0 1rem;
    }

    .dropzone {
        padding: 2rem 1rem;
    }

    .video-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-section {
        width: 100%;
    }

    .share-section .btn {
        flex: 1;
    }

    .trim-overlay {
        bottom: 45px;
        padding: 0.5rem 0.75rem;
    }

    .trim-overlay .trim-handle {
        width: 20px;
        height: 20px;
    }

    .custom-controls {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .ctrl-play-pause {
        width: 32px;
        height: 32px;
    }

    .ctrl-trim-handle {
        width: 20px;
        height: 20px;
    }

    .ctrl-time {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .file-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .share-url-container {
        flex-direction: column;
    }
}

/* Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--color-text-secondary);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text);
    background-color: var(--color-bg-tertiary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-size: 0.875rem;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.nav-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-form {
    margin: 0;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-control {
    padding: 0.75rem 1rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.form-group.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.validation-error {
    font-size: 0.75rem;
    color: var(--color-error);
}

.btn-full {
    width: 100%;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oauth-buttons form {
    margin: 0;
}

.btn-oauth {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-oauth svg {
    flex-shrink: 0;
}

.btn-google:hover {
    border-color: #4285f4;
}

.btn-steam:hover {
    border-color: #1b2838;
    background-color: #1b2838;
}

.btn-battlenet:hover {
    border-color: #0074e0;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.auth-footer a {
    font-weight: 500;
}

/* My Videos Page */
.my-videos-page {
    max-width: 960px;
    margin: 0 auto;
}

.my-videos-page h1 {
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius-lg);
}

.empty-state p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.video-card {
    display: block;
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

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

.video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: var(--color-bg-tertiary);
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.video-card .video-info {
    padding: 0.75rem;
    display: block;
}

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

.video-title-input {
    width: 100%;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    outline: none;
    box-sizing: border-box;
}

.video-title-input:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.video-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Video Actions */
.video-card {
    position: relative;
}

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

.video-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.75rem 0.75rem;
    justify-content: flex-end;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-action:hover {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.btn-rename:hover {
    color: var(--color-primary-light);
}

.btn-delete:hover {
    color: var(--color-error);
}

/* Loading Indicator */
.loading-trigger {
    padding: 2rem;
    text-align: center;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--color-text-secondary);
}

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

/* Responsive Grid */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-username {
        display: none;
    }

    .nav-avatar {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .nav-links .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Unmute overlay for Safari autoplay */
.unmute-overlay {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
}

.unmute-overlay:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateX(-50%) scale(1.05);
}

.unmute-overlay svg {
    width: 20px;
    height: 20px;
}


/* Visibility toggle button */
.btn-visibility {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-visibility:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

.btn-visibility.private {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.btn-visibility.private:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.5);
}

.btn-visibility svg {
    width: 14px;
    height: 14px;
}
