/* General Body & Theme */
:root {
    --primary-color: #e50914; /* Netflix Red */
    --background-color: #141414; /* Dark Background */
    --surface-color: #222;    /* Slightly lighter for cards */
    --text-color: #f5f5f5;
    --text-muted: #aaa;
    --container-width: 1200px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
}

/* --- Layout & Header --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.main-header {
    background-color: rgba(20, 20, 20, 0.8);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -1px;
}

.main-header nav a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
    font-size: 1rem;
    transition: color 0.3s;
}

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

/* --- Search Bar Section --- */
.search-section {
    padding: 20px 0;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex-grow: 1;
    padding: 12px 15px;
    font-size: 1rem;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 25px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.3);
}

.search-button {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #f6121d;
}

.search-button svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 40px 0;
}

/* --- Category Filter (index.php) --- */
.category-filter {
    padding: 30px 0;
}

.category-filter nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    background-color: var(--surface-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.category-btn:hover {
    color: var(--text-color);
    background-color: #333;
}

.category-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}


.video-details .category-tag {
    background-color: var(--primary-color);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 20px;
}

.video-details h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
}

/* --- Video Card Redesign --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.video-card a {
    text-decoration: none;
    color: var(--text-color);
}

.video-card a {
    text-decoration: none;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--surface-color);
    margin-bottom: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.thumbnail-container {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.7);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .thumbnail-overlay {
    opacity: 1;
}

.play-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(229, 9, 20, 0.8);
    border-radius: 50%;
    position: relative;
    backdrop-filter: blur(5px);
}

.play-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #ffffff;
}

.video-info {
    padding: 0 5px;
}

.video-title {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    align-items: center;
}

.meta-separator svg {
    width: 6px;
    height: 6px;
    fill: var(--text-muted);
    display: block;
}

/* --- Forms (Login & Upload) --- */
body.login-page, body.upload-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #121212;
}

body.login-page main,
body.upload-page main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.form-container {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.form-container.modern-form {
    border-top: 4px solid var(--primary-color);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #fff;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666;
}

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

.btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #f6121d;
}

/* --- Custom File Input (upload.php) --- */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    display: none;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #444;
    border-radius: 8px;
    background-color: #1a1a1a;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    text-align: center;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background-color: #222;
}

.file-upload-label.dragging {
    border-color: var(--primary-color);
    border-style: solid;
    background-color: #252525;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.5);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.upload-text {
    color: var(--text-muted);
    font-size: 1rem;
}

.upload-text strong {
    color: var(--text-color);
}

.file-name {
    margin-top: 15px;
    text-align: center;
    color: #ccc;
    font-style: italic;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Messages (Success/Error) --- */
.error-msg {
    background-color: #440c0c;
    color: #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    text-align: center;
    margin-bottom: 15px;
}
.success-msg {
    background-color: #0c440c;
    color: #c6f5c6;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #c6f5c6;
    text-align: center;
    margin-bottom: 15px;
}

/* Styling for the SVG Upload Icon */
.upload-icon svg {
    width: 40px;  /* Adjust size as needed */
    height: 40px; /* Adjust size as needed */
    fill: var(--text-muted); /* Sets the icon color */
    transition: fill 0.3s;
}

.file-upload-label:hover .upload-icon svg {
    fill: var(--primary-color); /* Changes color on hover */
}

/* --- Upload Progress Bar --- */
.progress-bar-container {
    display: none; /* Hidden by default */
    width: 100%;
    background-color: #333;
    border-radius: 5px;
    margin-bottom: 20px;
    position: relative;
    height: 30px;
    text-align: center;
    overflow: hidden;
}

.progress-bar {
    width: 0%; /* Starts at 0 */
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    width: 100%;
}

/* --- Watch Page --- */
body.watch-page {
    background-color: #121212;
}

/* --- Custom Video Player --- */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Fits video within container, adding black bars if needed */
}

.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.video-container:hover .custom-controls,
.custom-controls.visible {
    opacity: 1;
}

.progress-container {
    height: 5px;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    margin-bottom: 10px;
    border-radius: 2.5px;
    padding: 5px 0;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    border-radius: 2.5px;
}

.controls-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-button svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    transition: transform 0.2s;
}

.control-button:hover svg {
    transform: scale(1.1);
}

.control-button .hidden {
    display: none;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    outline: none;
    border-radius: 2.5px;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
}

#volumeSlider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
}

.time-display {
    color: #fff;
    font-size: 0.9rem;
}

.spacer {
    flex-grow: 1;
}

/* --- Definitive Fullscreen Mode Styling --- */
.video-container:-webkit-full-screen,
.video-container:-moz-full-screen,
.video-container:fullscreen {
    padding-top: 0 !important;
    border-radius: 0;
    width: 100%;
    height: 100%;
}

.video-container:fullscreen .video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-container:fullscreen .custom-controls {
    z-index: 2147483647;
    opacity: 1;
}

/* --- Video Action Buttons --- */
.video-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--surface-color);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--surface-color);
    color: var(--text-color);
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.action-btn:hover {
    background-color: #333;
    transform: translateY(-2px);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Specific style for the delete button */
.delete-btn {
    background-color: #5d1a1f; /* Dark red */
    color: #f5c6cb;
}

.delete-btn:hover {
    background-color: var(--primary-color); /* Bright red on hover */
    color: #fff;
}
/* --- Style for the "Copied!" checkmark icon --- */
.copy-success-icon {
    width: 18px;
    height: 18px;
    fill: #4CAF50; /* A pleasant green color */
    vertical-align: middle; /* Aligns the icon nicely with the text */
    margin-left: 5px;
}

.share-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; /* Using flex to center the content */
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.share-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.share-modal-content {
    background: var(--surface-color);
    padding: 30px 40px;
    border-radius: 12px;
    position: relative;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}
.close-modal-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.share-modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #fff;
}

.share-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}
.share-link:hover {
    transform: translateY(-2px);
}
.share-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Platform specific colors */
.share-link.facebook { background-color: #1877F2; color: #fff; }
.share-link.twitter { background-color: #000; color: #fff; }
.share-link.whatsapp { background-color: #25D366; color: #fff; }

.share-link.copy-link {
    background-color: #444;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

.share-link.copy-link:hover {
    background-color: #555;
}

.share-link.copy-link:disabled {
    cursor: default;
    opacity: 0.7;
}

.comments-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--surface-color);
}

.comments-section h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.comment-form {
    margin-bottom: 40px;
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.3);
}

.comment-form textarea {
    resize: vertical;
}

.submit-comment-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-comment-btn:hover {
    background-color: #f6121d;
}

.comments-list .comment {
    display: grid;
    grid-template-areas:
        "author date"
        "text   text";
    grid-template-columns: 1fr auto;
    gap: 5px 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.comments-list .comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.comment-author {
    grid-area: author;
    font-weight: bold;
    color: #fff;
}

.comment-date {
    grid-area: date;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}

.comment-text {
    grid-area: text;
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap; /* Preserves line breaks from textarea */
    word-wrap: break-word; /* Prevents long words from overflowing */
}

/* --- Logo Image Styling --- */
.logo img {
    display: block; 
    height: 60px;   /* <-- INCREASE THIS VALUE */
    width: auto;    
}


/* --- Quality Settings Menu --- */
.settings-container { position: relative; }
.settings-menu {
    display: none;
    position: absolute;
    bottom: 120%;
    right: 0;
    background-color: rgba(40, 40, 40, 0.9);
    border-radius: 4px;
    min-width: 80px;
}
.settings-menu.visible { display: block; }
.settings-menu-item {
    padding: 8px 15px;
    cursor: pointer;
}
.settings-menu-item:hover { background-color: rgba(255, 255, 255, 0.2); }
.settings-menu-item.active {
    background-color: var(--primary-color);
    font-weight: bold;
}

/* --- Upload Progress Display --- */
.progress-list { margin-top: 15px; padding: 15px; background-color: #333; border-radius: 8px; }
.progress-item { padding: 8px 0; border-bottom: 1px solid #444; }
.progress-item:last-child { border-bottom: none; }
.status { float: right; }
.status.pending { color: #ccc; }
.status.processing { color: #f0ad4e; }
.status.complete { color: #5cb85c; }
.status.error { color: #d9534f; }

/* --- Upload Status Icons --- */
.status-icon {
    width: 1em;
    height: 1em;
    vertical-align: middle; /* Aligns the icon nicely with the text */
    margin-left: 5px;
}

.status.complete .status-icon {
    fill: #5cb85c; /* Green color for the checkmark */
}

.status.error .status-icon {
    fill: #d9534f; /* Red color for the 'X' */
}

/* --- Upload Final Status Message --- */
.status-final-success {
    background-color: #e8f5e9; /* A light, pleasant green */
    color: #2e7d32; /* A darker, readable green for the text */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #a5d6a7; /* A soft green border */
    text-align: center;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease; /* A nice fade-in effect */
}

/* Style the "View Video" link inside the success message */
.status-final-success a {
    color: #1b5e20; /* An even darker green for contrast */
    text-decoration: underline;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.status-final-success a:hover {
    background-color: #c8e6c9; /* A subtle highlight on hover */
    text-decoration: none;
}

/* --- Upload Final Status Error Message --- */
.status-final-error {
    background-color: #ffebee; /* A light, warning red */
    color: #c62828; /* A darker, readable red for the text */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ef9a9a; /* A soft red border */
    text-align: center;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

/* --- Video Player Loading Spinner --- */
.player-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: player-spin 1s linear infinite;
    z-index: 25;
    display: none; /* Hidden by default */
}

.video-container.loading .player-loader {
    display: block; /* Show spinner when loading */
}

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

/* --- Video Speed Control Menu --- */

/* This is the container for the button and the menu */
.speed-control-container {
    position: relative; /* This is crucial for positioning the menu */
}

/* Style the button itself to match other control buttons */
#speedBtn {
    width: 55px; /* A fixed width prevents the layout from shifting */
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease;
}

/* A subtle zoom effect on hover */
#speedBtn:hover {
    transform: scale(1.1);
}

.speed-menu {
    display: none;
    position: absolute;
    bottom: 120%; 
    right: 0;
    background-color: rgba(25, 25, 25, 0.9); 
    border-radius: 6px;
    min-width: 80px;
    z-index: 30;
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* This class is added by JavaScript to show the menu */
.speed-menu.visible {
    display: block;
}

/* Style for each speed option (e.g., "1.5x") */
.speed-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: background-color 0.2s ease;
}

.speed-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.speed-menu-item.active {
    background-color: var(--primary-color); /* Uses your site's main theme color */
    font-weight: bold;
    color: #fff;
}

/* --- Seek Forward/Backward Indicators --- */
.seek-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Prevents interfering with clicks */
}
.seek-indicator svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}
#seekBackwardIndicator {
    left: 15%;
}
#seekForwardIndicator {
    right: 15%;
}
.seek-indicator.active {
    opacity: 1;
}

.seek-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-effect 0.5s ease-out;
    z-index: 21; /* Above the video, below the controls */
    pointer-events: none; /* Prevents the ripple from blocking clicks */
}

@keyframes ripple-effect {
    to {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* --- Unified Player Control Button Style --- */
.control-btn, .control-button {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.control-btn svg, .control-button svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    pointer-events: none; /* Prevents SVG from hijacking clicks */
}

/* Add a subtle zoom effect on hover/focus */
.control-btn:hover, .control-button:hover {
    transform: scale(1.1);
}


/* ====================================================== */
/* --- PLAYER MOBILE FIX (FINAL & CORRECTED) --- */
/* ====================================================== */
@media (max-width: 600px) {

    .controls-right {
        margin-left: auto;
        display: flex;
        align-items: center;
    }

    #volumeSlider {
        display: none;
    }

    .spacer {
        display: none;
    }

    .control-btn, .control-button {
        padding: 6px;
    }
    .control-btn svg, .control-button svg {
        width: 22px;
        height: 22px;
    }
    #speedBtn {
        font-size: 0.8rem;
        width: 45px;
    }
    .time-display {
        font-size: 0.8rem;
    }

    .settings-menu, .speed-menu {
        max-height: 45vh; 

        overflow-y: auto;
    }

    .settings-menu-item, .speed-menu-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}



.playlist-actions, .playlist-creator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-actions select, .playlist-creator input {
    flex-grow: 1;
}

.playlist-creator input {
    background-color: #2c2f33;
    border: 1px solid #555;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 1rem;
    width: auto; 
}

.btn-secondary {
    flex-shrink: 0; 
    background-color: #4f545c;
    color: #fff;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem; 
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #7289da;
}

.playlist-creator {
    display: none;
}


/* --- Playlist Panel Styles --- */
.playlist-container {
    margin: 20px 0;
}

.playlist-panel {
    display: none; /* Hidden by default */
    margin-top: 15px;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.playlist-panel.visible {
    display: block; /* Shown with JavaScript */
}

.playlist-panel h3 {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #333;
    font-size: 1.1rem;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #eee;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #2a2a2a;
}
.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background-color: #2c2f33;
}

.playlist-item.active {
    background-color: #3a3f44;
    font-weight: bold;
}

.playlist-item img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}


/* --- Autoplay Countdown Overlay Styles --- */
.autoplay-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 22; /* Make sure it's on top */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.autoplay-overlay.visible {
    display: flex; /* Use JS to add this class */
    opacity: 1;
}

.autoplay-content p {
    margin: 0 0 5px;
    font-size: 1rem;
    color: #ccc;
}

.autoplay-content h4 {
    margin: 0 0 15px;
    font-size: 1.5rem;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autoplay-content .countdown {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.autoplay-content .countdown span {
    font-weight: bold;
    font-size: 1.5rem;
}
.autoplay-thumbnail {
    display: block;
    width: 160px;
    height: 90px;
    object-fit: cover; 
    border-radius: 6px;
    border: 1px solid #444;
    margin: 10px auto 15px; 
}

#videoContainer.idle {
    cursor: none;
}

#videoContainer.idle #customControls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.caption-tabs { margin-bottom: 10px; }
.caption-tab-btn { background-color: #36393f; border: 1px solid #555; color: #ccc; padding: 8px 12px; cursor: pointer; border-radius: 5px; margin-right: 5px; }
.caption-tab-btn.active { background-color: #7289da; color: #fff; border-color: #7289da; }
/* --- Modal Styles for CAPTCHA --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #2c2f33;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    color: #fff;
}

.modal-content p {
    color: #b9bbbe;
    margin-bottom: 20px;
}

.g-recaptcha {
    display: inline-block; /* Center the captcha */
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-link.reddit {
    background-color: #FF4500;
    color: #fff;
}
.share-link.reddit:hover {
    background-color: #e03d00;
    color: #fff;
}

.share-link.linkedin {
    background-color: #0077B5;
    color: #fff;
}
.share-link.linkedin:hover {
    background-color: #0069a1;
    color: #fff;
}

.share-link.pinterest {
    background-color: #E60023;
    color: #fff;
}
.share-link.pinterest:hover {
    background-color: #cc001f;
    color: #fff;
}

.share-link.email {
    background-color: #7f8c8d;
    color: #fff;
}
.share-link.email:hover {
    background-color: #6e7b7c;
    color: #fff;
}

.share-link.reddit svg,
.share-link.linkedin svg,
.share-link.pinterest svg,
.share-link.email svg {
    fill: #fff;
}
