/**
 * Kingbokep - Main Stylesheet
 * TikTok-style Video Platform
 */

/* ========================================
   CSS Variables
======================================== */
:root {
    --primary-color: #fe2c55;
    --primary-hover: #e91e45;
    --secondary-color: #25f4ee;
    --background-dark: #000000;
    --background-card: #121212;
    --background-overlay: rgba(0, 0, 0, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #8a8b91;
    --text-muted: #5a5a5a;
    --border-color: #2f2f2f;
    --success-color: #00c853;
    --error-color: #ff1744;
    --warning-color: #ffc107;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --max-width: 480px;
    --sidebar-width: 60px;
    --header-height: 50px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --z-header: 100;
    --z-sidebar: 90;
    --z-modal: 200;
    --z-toast: 300;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   Layout
======================================== */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background-color: var(--background-dark);
}

@media (min-width: 481px) {
    .app-container {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }
}

.main-content {
    padding-top: var(--header-height);
}

/* ========================================
   Header
======================================== */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--header-height);
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-logo span {
    color: var(--primary-color);
}

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

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Video Feed
======================================== */
.video-feed {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    -webkit-overflow-scrolling: touch;
}

.video-item {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-dark);
}

/* ========================================
   Video Sidebar (Right Actions)
======================================== */
.video-sidebar {
    position: absolute;
    right: 10px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.sidebar-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sidebar-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.sidebar-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sidebar-btn.active {
    color: var(--primary-color);
}

.sidebar-btn.like-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-btn svg {
    width: 24px;
    height: 24px;
}

.sidebar-count {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   Video Info (Bottom)
======================================== */
.video-info {
    position: absolute;
    left: 0;
    right: 70px;
    bottom: 20px;
    padding: 0 15px;
    z-index: 10;
}

.video-username {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-username a:hover {
    text-decoration: underline;
}

.video-description {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-description.expanded {
    -webkit-line-clamp: unset;
}

.video-description .more-btn {
    color: var(--text-secondary);
    font-weight: 500;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.video-tag {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

.video-tag:hover {
    text-decoration: underline;
}

/* ========================================
   Progress Bar
======================================== */
.progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    z-index: 15;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
}

.progress-container:hover {
    height: 5px;
}

.progress-container:hover .progress-bar {
    background-color: var(--text-primary);
}

/* ========================================
   Mute Button
======================================== */
.mute-btn {
    position: absolute;
    top: 60px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    z-index: 20;
    transition: all var(--transition-fast);
}

.mute-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.mute-btn svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Search Bar
======================================== */
.search-container {
    padding: 10px 15px;
    background-color: var(--background-dark);
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--background-card);
    border-radius: 25px;
    padding: 8px 15px;
    gap: 10px;
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* ========================================
   Category Pills
======================================== */
.category-pills {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.category-pill {
    padding: 8px 16px;
    background-color: var(--background-card);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.category-pill:hover,
.category-pill.active {
    background-color: var(--text-primary);
    color: var(--background-dark);
}

/* ========================================
   Video Grid
======================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 2px;
}

.grid-item {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    background-color: var(--background-card);
}

.grid-item img,
.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.grid-item-title {
    font-size: 0.75rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.grid-item-stats {
    display: flex;
    gap: 10px;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.grid-item-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.grid-item-duration {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 500;
}

/* ========================================
   Modal
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-overlay);
    z-index: var(--z-modal);
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: var(--max-width);
    max-height: 80vh;
    background-color: var(--background-card);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* ========================================
   Comments
======================================== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-username {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
}

.comment-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* ========================================
   Share Modal
======================================== */
.share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    transition: background-color var(--transition-fast);
}

.share-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.share-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-icon.whatsapp { background-color: #25D366; }
.share-icon.twitter { background-color: #1DA1F2; }
.share-icon.facebook { background-color: #1877F2; }
.share-icon.telegram { background-color: #0088cc; }
.share-icon.copy { background-color: var(--text-secondary); }

.share-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

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

/* ========================================
   Age Verification
======================================== */
.age-verification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.age-verification-box {
    background-color: var(--background-card);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 360px;
}

.age-verification-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: var(--warning-color);
}

.age-verification-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.age-verification-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.age-verification-buttons {
    display: flex;
    gap: 10px;
}

.age-verification-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.btn-confirm {
    background-color: var(--primary-color);
    color: white;
}

.btn-confirm:hover {
    background-color: var(--primary-hover);
}

.btn-leave {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-leave:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.age-verification.hidden {
    display: none !important;
}

/* ========================================
   Toast Notifications
======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    width: 100%;
    max-width: var(--max-width);
    padding: 0 20px;
    pointer-events: none;
}

.toast {
    background-color: var(--background-card);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    animation: fadeInDown 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
    width: 100%;
}

/* ========================================
   Loading States
======================================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--background-card) 25%, #1a1a1a 50%, var(--background-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Utilities
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ========================================
   Responsive
======================================== */
@media (max-width: 480px) {
    .video-sidebar {
        right: 8px;
        bottom: 100px;
    }

    .sidebar-btn {
        width: 44px;
        height: 44px;
    }

    .video-info {
        right: 60px;
        bottom: 15px;
    }
}

/* ========================================
   Scrollbar
======================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
