/* Global Styles */
:root {
    --primary-color: #ff2d75;
    --secondary-color: #37e0ff;
    --bg-dark: #05070a;
    --bg-darker: #0b0d13;
    --bg-light: #141720;
    --bg-lighter: rgba(36, 43, 59, 0.72);
    --text-primary: #f7f9ff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
    --soft-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    --transition: all 0.28s cubic-bezier(0.45, 0, 0.2, 1);

    --accent-gradient: linear-gradient(135deg, var(--primary-color), #ff6f91);
    --surface-overlay: rgba(8, 8, 16, 0.75);

    /* Upload + shared accents */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    --accent: #8b5cf6;
    --success: #10b981;
    --bg-primary: #0b0d13;
    --bg-secondary: #14172a;
    --bg-tertiary: #1c2132;
    --bg-hover: rgba(255, 255, 255, 0.06);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 999px;

    /* Layout */
    --layout-sidebar-width: 280px;
    --video-backdrop: radial-gradient(circle at 20% 20%, rgba(52, 62, 92, 0.62), rgba(8, 10, 18, 0.96));
    --video-border-color: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(66, 38, 94, 0.25), rgba(5, 7, 12, 0.98));
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Sidebar */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--layout-sidebar-width);
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    height: 100vh;
    background: linear-gradient(180deg, rgba(11, 13, 19, 0.92), rgba(5, 7, 12, 0.98));
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(24px);
    z-index: 1000;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 168px;
    height: auto;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    overflow-y: auto;
    padding-right: var(--spacing-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition), transform var(--transition-fast);
    cursor: pointer;
    border-radius: var(--radius-md);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item i {
    font-size: 20px;
    width: 28px;
}

.nav-mira-icon {
    width: 30px;
    height: 30px;
    margin-right: 12px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.profile-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.profile-link:hover {
    opacity: 0.85;
}

.profile-avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.profile-info-small {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.settings-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.settings-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}
.btn-upload {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--accent-gradient);
    color: #fff;
    border-radius: var(--radius-pill);
    box-shadow: 0 18px 40px rgba(255, 45, 117, 0.25);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-upload:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 22px 54px rgba(255, 45, 117, 0.35);
}

.btn-logout {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    margin-left: var(--layout-sidebar-width);
    width: calc(100% - var(--layout-sidebar-width));
    height: 100vh;
    overflow-y: auto;
    position: relative;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    background: transparent;
}

.video-container {
    position: relative;
    width: 100%;
}

.video-item {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    background: var(--video-backdrop);
    transition: background var(--transition);
    box-sizing: border-box;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 1200;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Content */
.no-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 48px auto 0;
    padding: 56px 32px;
    max-width: 520px;
    text-align: center;
    color: var(--text-muted);
    background: radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0.08) 0%, rgba(20, 22, 32, 0.65) 75%, rgba(10, 11, 18, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(5, 6, 12, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

.no-content::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 24px;
    background: linear-gradient(120deg, rgba(120, 84, 255, 0.14), rgba(255, 127, 184, 0.08));
    opacity: 0.8;
    z-index: -1;
}

.no-content i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    font-size: 44px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(120, 84, 255, 0.4), rgba(46, 226, 255, 0.25));
    color: var(--text-primary);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.no-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.no-content p {
    max-width: 320px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Video Layout */
.video-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    position: relative;
}

.video-frame {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    max-height: 85vh;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--video-border-color);
}

.video-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    opacity: 0;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.player-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.45);
}

.player-toggle:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.video-frame.is-paused .player-toggle,
.video-frame.touched .player-toggle {
    opacity: 1;
    pointer-events: auto;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    padding: clamp(12px, 2.8vw, 26px);
    gap: clamp(10px, 2.4vw, 24px);
    pointer-events: none;
}

/* Volume Controls - Top Right */
.overlay-volume {
    grid-area: 1 / 2 / 2 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(8, 8, 16, 0.72);
    border-radius: 22px;
    backdrop-filter: blur(16px);
    pointer-events: auto;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.overlay-volume.volume-open,
.overlay-volume:hover,
.overlay-volume:focus-within {
    transform: translateY(-2px);
    background: rgba(12, 12, 22, 0.82);
    box-shadow: 0 22px 36px rgba(0, 0, 0, 0.4);
}

.player-volume-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.player-volume-btn:hover {
    transform: scale(1.08);
}

.player-volume-slider {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 30px;
    height: 110px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    pointer-events: none;
    cursor: pointer;
}

.overlay-volume:hover .player-volume-slider,
.overlay-volume:focus-within .player-volume-slider,
.overlay-volume.volume-open .player-volume-slider {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player-volume-slider::-webkit-slider-runnable-track {
    width: 8px;
    background: rgba(255, 255, 255, 0.38);
    border-radius: 999px;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(8, 8, 18, 0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    margin-top: -4px;
}

.player-volume-slider::-moz-range-track {
    width: 8px;
    background: rgba(255, 255, 255, 0.38);
    border-radius: 999px;
}

.player-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(8, 8, 18, 0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* User Info - Bottom Left */
.overlay-user-info {
    grid-area: 3 / 1 / 4 / 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    align-self: end;
    background: rgba(8, 8, 16, 0.7);
    border-radius: 20px;
    padding: 14px 18px;
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 32px rgba(0, 0, 0, 0.35);
    max-width: min(360px, 60vw);
}

.username-btn {
    background: none;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    text-align: left;
    transition: opacity 0.2s ease;
}

.username-btn:hover,
.username-btn:focus-visible {
    opacity: 0.85;
}

.anime-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
}

/* Action Buttons - Right Rail */
.video-actions-overlay {
    grid-area: 2 / 2 / 3 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2vw, 18px);
    pointer-events: auto;
    padding: 16px 12px;
    background: rgba(6, 6, 12, 0.58);
    border-radius: 26px;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 34px rgba(0, 0, 0, 0.32);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-size: 20px;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.72);
    transform: translateY(-4px);
    box-shadow: 0 22px 34px rgba(0, 0, 0, 0.34);
}

.action-btn .count {
    font-size: 11px;
    font-weight: 600;
    display: block;
    line-height: 1;
}

.profile-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-btn .user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Progress Bar - Bottom */

.overlay-progress {
    grid-area: 3 / 1 / 4 / 3;
    pointer-events: auto;
    width: 100%;
    align-self: end;
    padding-top: clamp(8px, 1.6vw, 16px);
}

.player-progress {
    cursor: pointer;
}

.player-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.player-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), #ff7a45);
    transition: width 0.1s linear;
}

.action-btn i {
    font-size: 18px;
}

.action-btn.active {
    background: rgba(255, 0, 80, 0.3);
    color: var(--primary-color);
}

.action-btn.active .count {
    color: var(--primary-color);
}

.bookmark-btn.active {
    background: rgba(0, 242, 234, 0.24);
    color: var(--secondary-color);
}

.bookmark-btn.active .count {
    color: var(--secondary-color);
}

@keyframes like-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

.video-meta {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: white;
}

.meta-primary {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.username {
    background: none;
    border: none;
    padding: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: opacity 0.2s ease;
}

.username:hover {
    opacity: 0.75;
}

.anime-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.btn-follow {
    padding: 10px 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
    backdrop-filter: blur(10px);
}

.btn-follow:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
}

.btn-follow.following {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.description-text {
    width: 100%;
    max-width: 1100px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    line-height: 1.6;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-darker);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Chat Modal */
.chat-modal {
    max-height: 80vh;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    align-self: flex-end;
    background: var(--primary-color);
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--bg-light);
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
}

.chat-input-container,
.comment-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.chat-input,
.comment-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.chat-input:focus,
.comment-input:focus {
    border-color: var(--primary-color);
}

.btn-send {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-send:hover {
    background: #e6004a;
    transform: scale(1.05);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-drawer-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.comment-drawer {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    pointer-events: none;
    visibility: hidden;
}

.comment-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.comment-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-drawer.is-open .comment-drawer-backdrop {
    opacity: 1;
}

.comment-drawer-panel {
    position: relative;
    margin-left: auto;
    width: min(420px, 100%);
    height: 100%;
    background: rgba(16, 16, 26, 0.96);
    backdrop-filter: blur(18px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    display: flex;
    flex-direction: column;
}

.comment-drawer.is-open .comment-drawer-panel {
    transform: translateX(0);
}

.comment-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comment-drawer-header h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

#commentsDrawerCount {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.comment-drawer-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}

.comment-drawer-close:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(90deg);
}

.comment-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-drawer-footer {
    padding: 18px 24px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Comments List */
.comments-list {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.comment-item {
    display: flex;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
    animation: messageSlide 0.3s ease;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.comment-content {
    flex: 1;
}

.comment-username {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
}

.comment-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

/* AI Chat Page */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-color);
}

.chat-header {
    padding: 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-header-info i {
    font-size: 32px;
    color: var(--primary-color);
}

.chat-header-info h2 {
    font-size: 24px;
    margin: 0;
}

.chat-header-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: messageSlide 0.3s ease;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--accent-color);
}

.message-content {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 12px;
    flex: 1;
}

.user-message .message-content {
    background: var(--primary-color);
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.chat-input-container {
    padding: 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: white;
    font-size: 14px;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-input-container button {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-input-container button:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Page Content */
.page-content {
    width: 100%;
    height: 100%;
    animation: pageFadeIn 0.35s ease;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#aiChatPage {
    padding: 0;
    background: transparent;
}

.logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
    transition: transform 0.3s ease, filter 0.3s ease;
}
/* Responsive */
@media (max-width: 768px) {
    /* Sidebar Mobile Behavior */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    }

    /* Sidebar overlay/backdrop */
    .sidebar.active::before {
        content: '';
        position: fixed;
        left: 280px;
        top: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Main Content */
    .main-content {
        margin-left: 0;
        width: 100%;
        height: 100vh;
    }
    
    /* Mobile Menu Button */
    .sidebar-toggle-btn,
    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: white;
        font-size: 20px;
        cursor: pointer;
        z-index: 1002;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .sidebar-toggle-btn:active,
    .mobile-menu-btn:active {
        background: rgba(0, 0, 0, 0.95);
        transform: scale(0.95);
    }

    .video-item {
        padding: 12px;
        border-radius: 0;
        height: 100vh;
    }

    .video-canvas,
    .video-frame {
        height: 100%;
        width: 100%;
        border-radius: 0;
    }

    .player-overlay {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        padding: 16px;
        gap: 14px;
    }

    .overlay-volume {
        grid-area: 1 / 1 / 2 / 2;
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .overlay-volume .player-volume-slider {
        height: 90px;
    }

    .video-actions-overlay {
        grid-area: 2 / 1 / 3 / 2;
        flex-direction: row;
        justify-content: flex-end;
        padding: 12px;
        border-radius: 20px;
    }

    .overlay-user-info {
        grid-area: 3 / 1 / 4 / 2;
        padding: 12px 16px;
        max-width: 100%;
    }

    .overlay-progress {
        grid-area: 4 / 1 / 5 / 2;
        padding-top: 8px;
    }

    .action-btn {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        font-size: 18px;
    }

    /* Comments Drawer Mobile */
    .comment-drawer-panel {
        width: 100%;
        max-width: 100%;
    }

    .comment-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    /* Buttons */
    .btn-follow {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Video Container */
    .video-container {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .video-item {
        padding: 20px 12px 120px 12px;
    }
}

/* Ultra Mobile - 480px ve altı */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Layout Adjustment */
    :root {
        --layout-sidebar-width: 0;
    }

    /* User Profile Section */
    .user-profile {
        flex-direction: column;
    }

    .profile-link {
        flex: 1;
    }

    /* Nav Items */
    .nav-item {
        padding: 12px 16px;
        font-size: 15px;
    }

    .nav-item i {
        font-size: 18px;
    }

    /* Sidebar Header */
    .logo {
        max-width: 140px;
    }

    /* Button */
    .btn-upload {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Video Actions */
    .video-actions-overlay {
        gap: 12px;
        padding: 10px;
    }

    .overlay-volume {
        padding: 10px 12px;
    }

    .overlay-volume .player-volume-slider {
        height: 72px;
    }

    .action-btn {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 16px;
    }

    .action-btn .count {
        font-size: 10px;
    }

    /* Comments Drawer */
    .comment-drawer-header {
        padding: 16px;
    }

    .comment-drawer-body {
        padding: 12px 16px;
    }

    .comment-item {
        gap: 10px;
        padding: 10px 12px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    /* Upload Page */
    .upload-container {
        padding: 12px;
    }

    .upload-zone {
        padding: 20px 12px;
    }

    .upload-steps {
        gap: 8px;
        padding: 12px 0;
    }

    .step {
        flex: 1;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Profile Page */
    .profile-header {
        padding: 12px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    /* Settings Page */
    .settings-container {
        padding: 12px;
    }

    .setting-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    /* Modals */
    .modal-content {
        width: 95vw;
        max-width: 95vw;
    }
}

/* Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }

    .video-item {
        height: 100vh;
    }

    .player-overlay {
        padding: 8px;
    }
}

/* Video Dynamic Background Color */
.video-frame {
    --video-dynamic-color: rgb(66, 38, 94);
}

.video-item {
    background: radial-gradient(
        circle at 20% 20%, 
        rgba(var(--video-dynamic-color), 0.15), 
        rgba(5, 7, 12, 0.98)
    ) !important;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix responsive padding issues */
.page-content {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Loading state improvements */
.loading-spinner {
    z-index: 1100;
}

/* Video container responsive fix */
.video-canvas {
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .video-canvas {
        gap: 16px;
    }

    .video-frame {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease-out;
}

.video-item {
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease;
}

/* Button fixes */
.btn {
    -webkit-tap-highlight-color: transparent;
}

/* Input field focus states */
input:focus, 
textarea:focus {
    outline: none;
}

/* Scrollbar improvement */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Mobile menu button visibility fix */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1002;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

/* Modal improvements */
.modal {
    z-index: 2000;
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Auth page responsive */
@media (max-width: 1200px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-panel-left {
        display: none;
    }

    .auth-panel-right {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Fix video item aspect ratio on small screens */
@media (max-width: 480px) {
    .video-item {
        aspect-ratio: auto;
        min-height: auto;
        padding: 20px 16px;
    }

    .video-frame {
        aspect-ratio: 9 / 16;
        max-height: 80vh;
    }
}

/* Prevent layout shift */
html {
    scrollbar-gutter: stable;
}

/* Fix sidebar active nav item */
.sidebar .nav-item.active {
    background: rgba(255, 45, 117, 0.15);
    color: var(--primary-color);
}

/* Better touch targets */
@media (hover: none) and (pointer: coarse) {
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

