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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: #111111;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #222;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.btn-signin {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-signin:hover {
    background-color: #2563eb;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-dashboard {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1rem;
    transition: color 0.2s ease;
}

.btn-dashboard:hover {
    color: #3b82f6;
}

.btn-logout {
    background-color: transparent;
    color: #ef4444;
    padding: 0.6rem 1.2rem;
    border: 1px solid #ef4444;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: #ffffff;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #3b82f6;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    color: #888;
}

/* Sign In Page */
.signin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    padding-top: 6rem;
}

.signin-card {
    background-color: #111111;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #222;
}

/* Auth Toggle */
.auth-toggle {
    display: flex;
    margin-bottom: 2rem;
    background-color: #0a0a0a;
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background-color: transparent;
    color: #888;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    color: #ccc;
}

.toggle-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #ccc;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #333;
    border-radius: 6px;
    background-color: #0a0a0a;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn-submit {
    width: 100%;
    padding: 0.85rem;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-submit:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#message {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

#message.success {
    color: #22c55e;
}

#message.error {
    color: #ef4444;
}

/* Dashboard */
.dashboard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    padding-top: 6rem;
}

.dashboard-card {
    background-color: #111111;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    border: 1px solid #222;
}

.dashboard-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background-color: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #222;
}

.info-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.1rem;
    color: #ffffff;
    word-break: break-all;
}

.info-uid {
    font-family: monospace;
    font-size: 0.95rem;
    color: #3b82f6;
}

/* Upload Section */
.upload-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #222;
}

.upload-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.upload-area {
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #0a0a0a;
}

.upload-area:hover {
    border-color: #3b82f6;
    background-color: #111;
}

.upload-area.dragover {
    border-color: #3b82f6;
    background-color: #1a1a2e;
}

.upload-icon {
    font-size: 2.5rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #888;
    font-size: 0.95rem;
}

.file-name {
    display: block;
    margin-top: 0.75rem;
    color: #3b82f6;
    font-size: 0.9rem;
    word-break: break-all;
}

.btn-upload {
    width: 100%;
    padding: 0.85rem;
    background-color: #22c55e;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

.btn-upload:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-upload:disabled {
    background-color: #333;
    color: #666;
    cursor: not-allowed;
}

.upload-progress {
    display: none;
    margin-top: 1rem;
    background-color: #222;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3b82f6;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-message {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.upload-message.success {
    color: #22c55e;
}

.upload-message.error {
    color: #ef4444;
}

/* Videos Page */
.videos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
    min-height: 100vh;
}

.videos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.videos-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.btn-upload-new {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-upload-new:hover {
    background-color: #2563eb;
}

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

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 3rem;
}

.no-videos {
    text-align: center;
    color: #888;
    padding: 3rem;
}

.no-videos a {
    color: #3b82f6;
    text-decoration: none;
}

.no-videos a:hover {
    text-decoration: underline;
}

.video-card {
    background-color: #111111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
    transition: border-color 0.2s ease;
}

.video-card:hover {
    border-color: #333;
}

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

.video-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Image preview in grid */
.video-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Audio preview in grid */
.audio-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    transition: transform 0.2s ease;
}

.play-btn:hover {
    transform: scale(1.1);
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    font-size: 0.85rem;
    color: #888;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.btn-action {
    flex: 1;
    padding: 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-download {
    background-color: #222;
    color: #ffffff;
    border: 1px solid #333;
}

.btn-download:hover {
    background-color: #333;
}

.btn-delete {
    background-color: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-delete:hover {
    background-color: #ef4444;
    color: #ffffff;
}

/* Video Player Page */
.player-body {
    overflow-x: hidden;
}

.player-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #000;
}

.player-container.theater-mode {
    background-color: #0a0a0a;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: #111;
    border-bottom: 1px solid #222;
}

.back-btn {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.back-btn:hover {
    background-color: #222;
}

.player-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ffffff;
    flex: 1;
    text-align: center;
    margin: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fullscreen-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.fullscreen-btn:hover {
    background-color: #222;
}

.video-player-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #000;
    max-height: calc(100vh - 150px);
}

.player-container.theater-mode .video-player-wrapper {
    max-height: calc(100vh - 100px);
}

.video-player-wrapper.fullscreen {
    max-height: 100vh;
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
}

.player-container.theater-mode .video-player-wrapper video {
    max-height: calc(100vh - 100px);
}

.video-player-wrapper.fullscreen video {
    max-height: 100vh;
}

/* Audio player auto-scaling */
.video-player-wrapper audio {
    width: 100%;
    max-width: 800px;
    margin: auto;
}

/* Image viewer auto-scaling */
.video-player-wrapper img {
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.player-container.theater-mode .video-player-wrapper img {
    max-height: calc(100vh - 100px);
}

.video-player-wrapper.fullscreen img {
    max-height: 100vh;
    max-width: 100vw;
}

/* Big Play Button */
.big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    padding-left: 6px;
    z-index: 10;
}

.big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(59, 130, 246, 1);
}

/* Player Controls */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 2rem 1rem 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-controls.visible,
.video-player-wrapper:hover .player-controls {
    opacity: 1;
}

.progress-container {
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
    transition: height 0.1s ease;
}

.progress-container:hover .progress-bar-bg {
    height: 6px;
}

.progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    width: 0%;
}

.progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    accent-color: #3b82f6;
}

.volume-control:hover .volume-slider {
    width: 80px;
    opacity: 1;
}

.time-display {
    color: #ffffff;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.speed-select {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.speed-select option {
    background-color: #222;
}

/* Video Details */
.video-details {
    padding: 1rem 1.5rem;
    background-color: #111;
    border-top: 1px solid #222;
}

.video-meta-info {
    color: #888;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .player-header {
        padding: 0.75rem 1rem;
    }

    .player-title {
        font-size: 0.95rem;
    }

    .controls-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .control-btn {
        font-size: 1rem;
        padding: 0.4rem;
        min-width: 35px;
    }

    .time-display {
        font-size: 0.8rem;
    }

    .volume-control:hover .volume-slider {
        width: 60px;
    }
}

/* Profile Picture Section (Dashboard) */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #222;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #333;
    transition: border-color 0.2s ease;
}

.profile-picture-container:hover {
    border-color: #3b82f6;
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-picture-container:hover .profile-picture-overlay {
    opacity: 1;
}

.profile-picture-overlay span {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-upload-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #666;
}

/* Explore Page */
.explore-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
    min-height: 100vh;
}

.explore-header {
    text-align: center;
    margin-bottom: 3rem;
}

.explore-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.explore-header p {
    color: #888;
    font-size: 1.1rem;
}

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

.no-users {
    text-align: center;
    color: #888;
    padding: 3rem;
}

.user-card {
    background-color: #111111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
    transition: all 0.2s ease;
}

.user-card:hover {
    border-color: #3b82f6;
    transform: translateY(-4px);
}

.user-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    border: 2px solid #333;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    text-align: center;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.user-joined {
    font-size: 0.85rem;
    color: #666;
}

/* Profile Page */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
    min-height: 100vh;
}

.profile-header-section {
    margin-bottom: 3rem;
}

.back-link {
    color: #888;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #3b82f6;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 2rem;
    background-color: #111;
    border-radius: 12px;
    border: 1px solid #222;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #333;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-joined {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.profile-video-count {
    color: #3b82f6;
    font-size: 0.95rem;
    font-weight: 500;
}

.profile-videos-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.nav-link.active {
    color: #3b82f6;
}

/* Responsive Auto-Scaling */

/* Tablets and smaller desktops */
@media (max-width: 1024px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .container {
        padding: 5rem 1.5rem 2rem;
    }

    .profile-container {
        padding: 5rem 1.5rem 2rem;
    }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav-right {
        gap: 0.5rem;
    }

    .btn-signin,
    .btn-logout,
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .player-header {
        padding: 1rem;
    }

    .player-title {
        font-size: 1.25rem;
    }

    /* Scale player controls for tablets */
    .control-btn {
        padding: 0.5rem;
        font-size: 1rem;
    }

    .big-play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Mobile portrait */
@media (max-width: 600px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .profile-info {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-details h1 {
        font-size: 1.5rem;
    }

    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .user-avatar {
        width: 60px;
        height: 60px;
    }

    .container {
        padding: 4.5rem 1rem 2rem;
    }

    .profile-container {
        padding: 4.5rem 1rem 2rem;
    }

    /* Mobile player adjustments */
    .video-player-wrapper video,
    .video-player-wrapper img {
        max-height: calc(100vh - 100px);
    }

    .player-controls {
        padding: 1.5rem 0.75rem 0.75rem;
    }

    .controls-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .control-btn {
        padding: 0.4rem;
        font-size: 0.9rem;
    }

    .time-display {
        font-size: 0.85rem;
    }

    .speed-select {
        font-size: 0.85rem;
        padding: 0.25rem;
    }

    .big-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Mobile video card adjustments */
    .video-title {
        font-size: 0.9rem;
    }

    .video-meta {
        font-size: 0.8rem;
    }

    .play-btn {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    /* Audio preview scaling */
    .audio-preview {
        font-size: 3rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 400px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .navbar {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .btn-signin,
    .btn-logout,
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .control-btn {
        padding: 0.3rem;
        font-size: 0.85rem;
    }

    .volume-slider {
        width: 40px;
    }

    /* Simplify controls on very small screens */
    .controls-left,
    .controls-right {
        gap: 0.25rem;
    }

    .audio-preview {
        font-size: 2.5rem;
    }
}

/* Landscape orientation handling */
@media (max-height: 500px) and (orientation: landscape) {
    .video-player-wrapper video,
    .video-player-wrapper img,
    .video-player-wrapper audio {
        max-height: 90vh;
    }

    .player-controls {
        padding: 0.5rem;
    }

    .big-play-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .progress-container {
        margin-bottom: 0.25rem;
    }
}

/* ==================== COMMENTS SECTION ==================== */

.comments-section {
    background-color: #111;
    padding: 1.5rem;
    border-top: 1px solid #222;
    max-width: 900px;
    margin: 0 auto;
}

.comments-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.comments-title span {
    color: #888;
    font-weight: 400;
}

/* Comment Form */
.comment-form {
    margin-bottom: 2rem;
}

.comment-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #333;
}

#comment-input {
    flex: 1;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #ffffff;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    resize: none;
    font-family: inherit;
    min-height: 24px;
    transition: border-color 0.2s ease;
}

#comment-input:focus {
    outline: none;
    border-bottom-color: #3b82f6;
}

#comment-input::placeholder {
    color: #666;
}

.comment-actions {
    display: none;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-left: 56px;
}

.btn-cancel-comment {
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 18px;
    transition: all 0.2s ease;
}

.btn-cancel-comment:hover {
    background-color: #222;
    color: #ffffff;
}

.btn-submit-comment {
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 18px;
    transition: all 0.2s ease;
}

.btn-submit-comment:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-submit-comment:disabled {
    background-color: #1e3a5f;
    color: #4a5568;
    cursor: not-allowed;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.comments-loading,
.no-comments {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-size: 0.95rem;
}

/* Individual Comment */
.comment-item {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
}

.comment-time {
    font-size: 0.8rem;
    color: #666;
}

.btn-delete-comment {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    margin-left: auto;
}

.comment-item:hover .btn-delete-comment {
    opacity: 1;
}

.btn-delete-comment:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

.comment-text {
    font-size: 0.95rem;
    color: #e0e0e0;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Comments Responsive */
@media (max-width: 768px) {
    .comments-section {
        padding: 1rem;
    }

    .comments-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
    }

    .comment-input-wrapper {
        gap: 0.75rem;
    }

    .comment-actions {
        padding-left: 47px;
    }

    #comment-input {
        font-size: 0.9rem;
    }

    .comment-author {
        font-size: 0.85rem;
    }

    .comment-text {
        font-size: 0.9rem;
    }

    .btn-delete-comment {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .comments-section {
        padding: 0.75rem;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
    }

    .comment-input-wrapper {
        gap: 0.5rem;
    }

    .comment-actions {
        padding-left: 42px;
        gap: 0.5rem;
    }

    .btn-cancel-comment,
    .btn-submit-comment {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}
