/* ================================================
   PROSHORTS - PROFESSIONAL SHORT VIDEO PLAYER
   Premium UI Design
   ================================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Color Palette */
    --primary: #ff0050;
    --primary-dark: #d90042;
    --secondary: #00d9ff;
    --accent: #ff6b35;
    
    /* Backgrounds */
    --bg-dark: #000000;
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.1);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #999999;
    
    /* UI Elements */
    --border-radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
    margin: 0;
    user-select: none;
}

/* === LOADING SCREEN === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-ring {
    position: absolute;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-ring:nth-child(1) {
    width: 100px;
    height: 100px;
    animation-duration: 1.5s;
}

.loader-ring:nth-child(2) {
    width: 80px;
    height: 80px;
    border-top-color: var(--secondary);
    animation-duration: 1.2s;
}

.loader-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    border-top-color: var(--accent);
    animation-duration: 0.9s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

/* === SHORTS CONTAINER === */
.shorts-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg-dark);
}

.shorts-container::-webkit-scrollbar {
    display: none;
}

/* === VIDEO SLIDE === */
.video-slide {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

.video-container {
    width: 100%;
    height: 100%;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === GRADIENT OVERLAYS === */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        transparent 20%,
        transparent 70%,
        rgba(0, 0, 0, 0.8) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* === PLAY/PAUSE OVERLAY === */
.play-pause-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100px;
    height: 100px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-slide.show-pause .play-pause-overlay,
.video-slide.show-play .play-pause-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.play-pause-overlay i {
    font-size: 3rem;
    color: white;
}

/* === PROGRESS BAR === */
.progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 1rem 0.5rem;
    z-index: 10;
    pointer-events: none;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    cursor: pointer;
    pointer-events: all;
    transition: height 0.2s;
}

.progress-bar:hover {
    height: 5px;
}

.progress-bar.active {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-thumb,
.progress-bar.active .progress-thumb {
    opacity: 1;
}

.progress-time {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.progress-bar:hover .progress-time,
.progress-bar.active .progress-time {
    opacity: 1;
}

/* === GLOBAL OVERLAY === */
.global-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    max-width: 600px;
    margin: 0 auto;
}

/* === TOP BAR === */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    pointer-events: all;
}

.top-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
}

.top-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

.icon-btn {
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.125rem;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* === VIDEO COUNTER === */
.video-counter {
    position: absolute;
    top: 5rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0.875rem;
    border-radius: 1.5rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    pointer-events: all;
}

.current-video {
    color: var(--primary);
}

.separator {
    color: var(--text-muted);
}

.total-videos {
    color: var(--text-secondary);
}

/* === SIDE CONTROLS === */
.side-controls {
    position: absolute;
    right: 1rem;
    bottom: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 10;
    pointer-events: all;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-btn:active {
    transform: scale(0.9);
}

.control-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.control-btn:hover .control-icon {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.control-btn.active .control-icon {
    background: var(--primary);
    border-color: var(--primary);
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* === BOTTOM INFO === */
.bottom-info {
    position: absolute;
    bottom: 4rem;
    left: 1rem;
    right: 5rem;
    z-index: 10;
    pointer-events: all;
}

.creator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.creator-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid white;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.creator-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.creator-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.follow-btn {
    padding: 0.375rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: 1.25rem;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: auto;
}

.follow-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.video-description {
    font-size: 0.875rem;
    line-height: 1.5;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 0.5rem;
    max-height: 3rem;
    overflow: hidden;
    position: relative;
}

.video-description.expanded {
    max-height: none;
}

.read-more {
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

/* === SETTINGS PANEL === */
.settings-panel,
.share-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.settings-panel.active,
.share-panel.active {
    transform: translateY(0);
}

.settings-header,
.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3,
.share-header h3 {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.settings-header h3 i,
.share-header h3 i {
    color: var(--primary);
}

.close-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.125rem;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    transition: background 0.3s;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
}

.setting-info > i {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--secondary);
    font-size: 1.125rem;
}

.setting-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.setting-select {
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.setting-select:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* === TOGGLE SWITCH === */
.toggle-switch {
    position: relative;
    width: 3rem;
    height: 1.75rem;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1.75rem;
    transition: 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 1.25rem;
    width: 1.25rem;
    left: 0.25rem;
    bottom: 0.25rem;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(1.25rem);
}

/* === SHARE PANEL === */
.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 0.875rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.share-option i {
    font-size: 1.75rem;
}

.share-option span {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9375rem;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

/* Tablet & Desktop */
@media (min-width: 768px) {
    .shorts-container {
        max-width: 480px;
    }
    
    .global-overlay {
        max-width: 480px;
    }
}

/* Mobile Landscape */
@media (max-height: 600px) and (orientation: landscape) {
    .video-counter {
        top: 4rem;
    }
    
    .side-controls {
        bottom: 4rem;
        gap: 1rem;
    }
    
    .control-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .bottom-info {
        bottom: 2rem;
    }
}

/* Small Mobile */
@media (max-width: 375px) {
    .control-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
    
    .control-label {
        font-size: 0.6875rem;
    }
    
    .share-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Print */
@media print {
    .global-overlay,
    .settings-panel,
    .share-panel,
    .toast {
        display: none !important;
    }
}