/* Discover Page - TikTok Style Dark Theme */

#discover-app {
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Header - Minimized */
.discover-header {
    background: transparent;
    padding: 12px 0 0 0;  /* Remove side padding, keep top padding */
    border-bottom: none;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.discover-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Container */
.discover-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;  /* Remove padding to eliminate white borders */
}

/* Video Container */
.video-container {
    background: transparent;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    min-height: 500px;
    position: relative;
}

/* Loading State */
.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    padding: 40px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state p {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 10px 0;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Video Card */
.video-card {
    display: flex;
    flex-direction: column;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.video-card:active {
    cursor: grabbing;
}

/* Video Embed */
#video-embed-container {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #1a1a1a; /* Darker gray, not pure black */
    position: relative;
    overflow: hidden;
    padding: 8px 8px 0 8px; /* Add padding around video */
    box-sizing: border-box;
}

#video-embed-container iframe {
    width: 100%;
    height: calc(100% - 8px); /* Account for top padding */
    border: none;
    border-radius: 8px;
}

/* Swipe Overlay - Invisible layer on top half of video for swipe gestures */
.video-swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%; /* Cover top 60% of video, leave bottom 40% for controls */
    z-index: 10; /* Above video iframe */
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.video-swipe-overlay:active {
    cursor: grabbing;
}

/* Video Info */
.video-info {
    padding: 20px;
    background: transparent;
}

#video-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.video-creator {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.video-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.tag.quick { background: #FFA500; color: #000; }
.tag.healthy { background: #32CD32; color: #000; }
.tag.vegetarian { background: #7CFC00; color: #000; }
.tag.dessert { background: #FFB6C1; color: #000; }

/* Swipe Controls */
.swipe-controls {
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    background: transparent;
    border-top: none;
    gap: 12px;
}

.swipe-controls button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-skip {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-skip:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

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

.btn-add:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

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

.btn-save:hover {
    background: #28a745;
    transform: translateY(-2px);
}

.btn-save.saved {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-large {
    max-width: 800px;
}

.close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--accent-primary);
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.category-item input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary {
    flex: 1;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Saved Videos List */
.saved-videos-list {
    display: grid;
    gap: 16px;
}

.saved-video-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-video-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.saved-video-thumbnail {
    width: 80px;
    height: 140px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.saved-video-info {
    flex: 1;
}

.saved-video-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.saved-video-creator {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Notification */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--accent-primary);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 2000;
    animation: slideIn 0.3s ease;
    display: none;
}

.notification.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .discover-main {
        padding: 10px;
    }

    .video-container {
        border-radius: 12px;
    }

    .swipe-controls {
        flex-direction: column;
    }

    .swipe-controls button {
        width: 100%;
    }
}
