/* ==========================================================================
   PINKSTAR CCTV - DARK GLASSMORPHISM DESIGN SYSTEM (WITH MOBILE & SHARE UI)
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-deep: #07090e;
    --bg-surface: #0e121a;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(26, 34, 52, 0.85);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.35);
    --border-accent: rgba(16, 185, 129, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --cyan-glow: #06b6d4;
    --cyan-glow-light: #22d3ee;
    --emerald-live: #10b981;
    --amber-warn: #f59e0b;
    --rose-err: #f43f5e;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radius & Transitions */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.03) 0px, transparent 60%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-layout {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 22px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-glow {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid var(--cyan-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    flex-shrink: 0;
}

.brand-icon {
    width: 22px;
    height: 22px;
    color: var(--cyan-glow-light);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cyan-glow-light);
    letter-spacing: 1.2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Header Share Action Button */
.btn-header-action {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: var(--cyan-glow-light);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-header-action .action-icon {
    width: 14px;
    height: 14px;
}

.btn-header-action:hover {
    background: rgba(6, 182, 212, 0.25);
    border-color: var(--cyan-glow);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

/* User Profile & Logout */
.user-profile-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cyan-glow-light);
}

.user-pill.guest-mode {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
}

.user-icon {
    width: 14px;
    height: 14px;
}

.btn-logout {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #f87171;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-logout svg {
    width: 13px;
    height: 13px;
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
    color: #ffffff;
    transform: translateY(-1px);
}

.connection-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #34d399;
}

.connection-badge.connecting {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.connection-badge.error {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: #f87171;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.current-time-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.time-icon {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   LOGIN SECTION
   ========================================================================== */
.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    width: 100%;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(6, 182, 212, 0.08);
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: fadeIn 0.4s ease-out;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lock-shield-icon {
    width: 54px;
    height: 54px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--cyan-glow);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
    margin-bottom: 6px;
}

.lock-shield-icon svg {
    width: 26px;
    height: 26px;
    color: var(--cyan-glow-light);
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-primary);
}

.login-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.form-input {
    width: 100%;
    background: rgba(10, 14, 22, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px 12px 42px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-input:focus {
    border-color: var(--cyan-glow);
    background: rgba(15, 22, 34, 0.95);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--cyan-glow-light);
}

.form-select {
    padding-right: 30px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.login-error-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fda4af;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    animation: fadeIn 0.2s ease-in;
}

.login-error-msg svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #f43f5e;
}

.btn-submit-login {
    margin-top: 6px;
    background: linear-gradient(135deg, #0891b2 0%, #0284c7 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: #ffffff;
    padding: 13px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
}

.btn-submit-login:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #0369a1 100%);
    box-shadow: 0 6px 22px rgba(6, 182, 212, 0.5);
    transform: translateY(-1px);
}

.btn-submit-login:active {
    transform: translateY(1px);
}

.btn-arrow {
    width: 17px;
    height: 17px;
    transition: transform 0.2s ease;
}

.btn-submit-login:hover .btn-arrow {
    transform: translateX(3px);
}

/* ==========================================================================
   VIDEO STAGE & STREAM CONTAINER
   ========================================================================== */
.video-stage {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-container {
    position: relative;
    width: 100%;
    background: #020408;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(6, 182, 212, 0.25);
    box-shadow: 
        0 25px 60px -15px rgba(0, 0, 0, 0.85), 
        0 0 40px rgba(6, 182, 212, 0.08);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    transition: var(--transition-smooth);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    transition: filter 0.3s ease;
}

.video-player.paused {
    filter: brightness(0.6) grayscale(30%);
}

/* Overlay Loader */
.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 14, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 20;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner-loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top-color: var(--cyan-glow);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.overlay-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Video HUD (Top Bar on Video) */
.video-hud-top {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
    flex-wrap: wrap;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hud-item {
    background: rgba(10, 15, 26, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hud-item.live-tag {
    background: rgba(225, 29, 72, 0.85);
    border-color: rgba(244, 63, 94, 0.5);
    color: #ffffff;
}

.hud-dot {
    width: 7px;
    height: 7px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: pulse 1.2s infinite;
}

.hud-item.res-tag, .hud-item.fps-tag {
    font-family: var(--font-mono);
    color: var(--cyan-glow-light);
}

.hud-item.mode-tag {
    font-family: var(--font-mono);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.4);
}

.hud-icon {
    width: 14px;
    height: 14px;
}

/* Controls Bar at Bottom of Video */
.video-controls-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(5, 8, 14, 0.95) 0%, rgba(5, 8, 14, 0.6) 70%, transparent 100%);
    padding: 24px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    opacity: 0.94;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-container:hover .video-controls-bar {
    opacity: 1;
}

/* Tap-to-toggle / Auto-hide on Touch Devices */
.video-container.controls-hidden .video-controls-bar {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(12px);
}

.video-container.controls-hidden .video-hud-top {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-12px);
}

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

.btn-control {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-control svg {
    width: 18px;
    height: 18px;
    color: #e2e8f0;
}

.btn-control:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--cyan-glow);
    transform: scale(1.05);
}

.btn-control:hover svg {
    color: var(--cyan-glow-light);
}

/* Engine Toggle Button */
.btn-engine-toggle {
    width: auto;
    padding: 0 12px;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.btn-engine-toggle .engine-icon {
    width: 14px;
    height: 14px;
}

.btn-engine-toggle:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
}

.btn-control#btnSnapshot {
    width: auto;
    padding: 0 14px;
    gap: 8px;
}

.btn-label {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Quality Switcher */
.stream-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 3px;
}

.btn-quality {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-quality.active {
    background: var(--cyan-glow);
    color: #03131a;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.btn-quality:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   FULLSCREEN & PSEUDO-FULLSCREEN (FOR IPHONE / SAFARI)
   ========================================================================== */
:fullscreen .video-container {
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
}

.video-container.pseudo-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    background: #000000 !important;
    aspect-ratio: auto !important;
}

.video-container.pseudo-fullscreen .video-player {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
}

/* ==========================================================================
   SHARE MANAGER MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 8, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.modal-card {
    background: #0d121c;
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.15);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid var(--cyan-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan-glow-light);
}

.modal-icon-badge svg {
    width: 20px;
    height: 20px;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.modal-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-modal-close:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: #f43f5e;
    color: #ffffff;
}

.btn-modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Create Share Form */
.share-create-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.share-form-row {
    display: flex;
    gap: 14px;
}

.share-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.share-form-field.note-field {
    flex: 1;
}

.share-form-field.duration-field {
    width: 180px;
}

.share-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-create-share {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    border: none;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-create-share:hover {
    background: linear-gradient(135deg, #22d3ee 0%, #0369a1 100%);
    transform: translateY(-1px);
}

.btn-create-share svg {
    width: 16px;
    height: 16px;
}

/* Share List Header */
.share-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.share-list-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-list-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.share-count-badge {
    background: rgba(6, 182, 212, 0.2);
    color: var(--cyan-glow-light);
    border: 1px solid rgba(6, 182, 212, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.btn-refresh-shares {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.btn-refresh-shares:hover {
    color: var(--cyan-glow-light);
    background: rgba(255, 255, 255, 0.05);
}

.btn-refresh-shares svg {
    width: 16px;
    height: 16px;
}

/* Share Link Cards */
.share-links-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

.share-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--text-muted);
    gap: 10px;
}

.share-empty-state .empty-icon {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.share-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-smooth);
}

.share-item-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.share-item-card.is-watching {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.share-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.share-item-note {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.share-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.share-status-pill.watching {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
}

.share-status-pill.active {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: var(--cyan-glow-light);
}

.share-status-pill.revoked {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
}

.share-status-pill.expired {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.share-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.share-detail-col {
    display: flex;
    align-items: center;
    gap: 4px;
}

.share-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-share-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-share-action.btn-copy-link {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid var(--cyan-glow);
    color: var(--cyan-glow-light);
}

.btn-share-action.btn-copy-link:hover {
    background: var(--cyan-glow);
    color: #03131a;
}

.btn-share-action.btn-revoke-link {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #f87171;
}

.btn-share-action.btn-revoke-link:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
    color: #ffffff;
}

.btn-share-action.btn-delete-link {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.btn-share-action.btn-delete-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100000;
}

.toast {
    background: rgba(14, 20, 32, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--cyan-glow);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(6, 182, 212, 0.2);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateX(0);
}

/* Utilities */
.hide {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET & LANDSCAPE)
   ========================================================================== */

@media (max-width: 768px) {
    .app-layout {
        padding: 12px 14px;
        gap: 14px;
    }
    .app-header {
        padding: 10px 14px;
    }
    .brand-title {
        font-size: 1.05rem;
    }
    .brand-subtitle {
        display: none;
    }
    .btn-label, .engine-mode-text {
        display: none;
    }
    .hud-item.res-tag, .hud-item.mode-tag {
        display: none;
    }
    .login-card {
        padding: 30px 20px;
    }
    .current-time-box {
        display: none;
    }
    .video-controls-bar {
        padding: 16px 12px 12px;
    }
    .btn-control {
        width: 36px;
        height: 36px;
    }
    .share-form-row {
        flex-direction: column;
    }
    .share-form-field.duration-field {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-brand {
        gap: 8px;
    }
    .brand-logo-glow {
        width: 36px;
        height: 36px;
    }
    .brand-title {
        font-size: 0.95rem;
    }
    .btn-header-action .btn-text {
        display: none;
    }
    .btn-header-action {
        padding: 7px 10px;
    }
    .user-pill {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    .connection-badge .badge-text {
        display: none;
    }
    .connection-badge {
        padding: 7px 9px;
    }
    .video-hud-top {
        top: 8px;
        left: 8px;
        right: 8px;
        gap: 4px;
    }
    .hud-item {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    .video-controls-bar {
        padding: 12px 8px 8px;
    }
    .controls-left, .controls-right {
        gap: 6px;
    }
}

/* ==========================================================================
   LANDSCAPE AUTO-ROTATE (XOAY NGANG ĐIỆN THOẠI TRÀN TOÀN MÀN HÌNH)
   ========================================================================== */
@media (orientation: landscape) and (max-height: 550px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    .app-layout {
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        min-height: 100vh !important;
        height: 100vh !important;
    }
    .app-header {
        display: none !important; /* Ẩn header khi xoay ngang để ưu tiên 100% video */
    }
    .main-content {
        flex: 1 !important;
        height: 100vh !important;
        width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .video-stage {
        height: 100vh !important;
        width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .video-container {
        border-radius: 0 !important;
        border: none !important;
        width: 100vw !important;
        height: 100vh !important;
        aspect-ratio: auto !important;
        max-height: 100vh !important;
        box-shadow: none !important;
    }
    .video-player {
        width: 100vw !important;
        height: 100vh !important;
        object-fit: contain !important;
    }
    .video-hud-top {
        top: env(safe-area-inset-top, 8px) !important;
        left: env(safe-area-inset-left, 12px) !important;
        right: env(safe-area-inset-right, 12px) !important;
    }
    .video-controls-bar {
        padding: 8px env(safe-area-inset-right, 16px) calc(6px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 16px) !important;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%) !important;
    }
}
