:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f9fafb;
    --border: #e5e7eb;
    --text: #374151;
    --text-light: #6b7280;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-dropdown: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Profile Dropdown Styles */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    border: 1px solid var(--border);
    padding: 8px;
    z-index: 1000;
    transform-origin: top right;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.dropdown-user-name {
    display: block;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--dark);
}

.dropdown-user-email {
    display: block;
    font-size: 0.8em;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
}

.dropdown-item.logout {
    color: var(--danger);
    margin-top: 4px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
}

.dropdown-item.logout:hover {
    background: #fff1f2;
}

.hidden {
    display: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 800;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 1.1em;
}

.auth-form h2 {
    color: var(--dark);
    margin-bottom: 25px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1em;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85em;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-text {
    background: transparent;
    color: var(--text-light);
    padding: 8px 16px;
}

.btn-text:hover {
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Payment Modal */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.payment-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.payment-content h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2em;
}

.payment-info {
    color: var(--text-light);
    margin-bottom: 30px;
}

.payment-details {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.payment-details>div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.payment-details>div:last-child {
    margin-bottom: 0;
}

.payment-details .label {
    font-weight: 600;
    color: var(--dark);
}

.payment-details .value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2em;
}

.payment-details .value.pending {
    color: var(--warning);
}

.qr-code-container {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.qr-code-container img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.copy-paste-container {
    margin: 20px 0;
}

.copy-paste-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
}

.copy-input-group {
    display: flex;
    gap: 10px;
}

.copy-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.9em;
}

.payment-instructions {
    background: #eff6ff;
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px 0;
}

.payment-instructions h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.payment-instructions ol {
    margin-left: 20px;
}

.payment-instructions li {
    margin-bottom: 8px;
    color: var(--text);
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--light);
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    width: 100%;
    border-bottom: 1px solid var(--border);
}

.navbar-brand h1 {
    color: var(--primary);
    font-size: 1.8em;
    font-weight: 800;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    color: var(--dark);
    font-weight: 600;
}

/* Horizontal Menu */
.navbar-menu {
    width: 100%;
    background: white;
    padding: 0 30px;
}

.horizontal-menu {
    list-style: none;
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.menu-item {
    display: block;
    padding: 15px 20px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0;
}

.menu-item:hover {
    color: var(--primary);
    background: transparent;
}

.menu-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    background: transparent;
}

/* Trial Banner */
.trial-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 60px;
    z-index: 999;
    animation: slideDown 0.3s ease-out;
}

.trial-banner.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
}

.trial-banner-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.trial-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.trial-info i {
    font-size: 18px;
}

.trial-upgrade-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.trial-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.85em;
    border-top: 1px solid var(--border);
    background: white;
    margin-top: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.view-header h2 {
    color: var(--dark);
    font-size: 2em;
    font-weight: 700;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1em;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1em;
    cursor: pointer;
    background: white;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Netflix Style Layout */
.hero-section {
    height: 60vh;
    min-height: 400px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), var(--dark)), url('https://images.unsplash.com/photo-1574375927938-d5a98e8ffe85?q=80&w=1469&auto=format&fit=crop') center/cover;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    padding: 60px;
    margin-bottom: 40px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.hero-content {
    color: white;
    max-width: 600px;
    z-index: 2;
}

.hero-title {
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

.hero-description {
    font-size: 1.2em;
    margin-bottom: 25px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Attachment Menu Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.2s ease-out forwards;
}

#shareAttachmentMenu {
    z-index: 9999 !important;
    /* Force high z-index */
    min-width: 250px;
}

.category-row {
    margin-bottom: 40px;
}

.category-title {
    font-size: 1.5em;
    color: var(--dark);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--primary);
}

.videos-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 20px 20px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
    /* Force equal height */
}

.videos-carousel::-webkit-scrollbar {
    height: 8px;
}

.videos-carousel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.videos-carousel::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.videos-carousel .video-card {
    min-width: 320px;
    width: 320px;
    flex-shrink: 0;
    height: auto;
    /* Allow stretch */
}

/* Videos Grid (Fallback/Search) */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Modal Enhancements */
.video-player-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
}


.video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--light);
}

.video-info {
    padding: 15px;
}

.video-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3em;
    /* Enforce 2 lines height */
    line-height: 1.5em;
    /* Explicit line height */
}

.video-channel {
    color: var(--text-light);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    background: var(--light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.video-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.9em;
}

/* Categories List */
.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.category-info h3 {
    color: var(--dark);
    margin-bottom: 5px;
}

.category-info p {
    color: var(--text-light);
    font-size: 0.9em;
}

/* Subscription Info */
.subscription-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .subscription-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.subscription-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .subscription-card {
        padding: 20px;
        overflow: hidden;
    }

    .subscription-card h3 {
        font-size: 1.2em;
        word-wrap: break-word;
    }

    .subscription-card .btn {
        width: 100%;
        font-size: 0.9em;
        padding: 12px;
        white-space: normal;
        word-wrap: break-word;
    }
}

.subscription-card h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.status-badge {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.payment-history {
    background: var(--light);
    padding: 30px;
    border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
    .payment-history {
        padding: 15px;
        overflow: hidden;
    }

    .payment-history h3 {
        font-size: 1.1em;
        word-wrap: break-word;
    }
}

.payment-history h3 {
    color: var(--dark);
    margin-bottom: 20px;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 25px;
    border-radius: var(--radius);
    color: white;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 800;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th {
    background: var(--primary);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: var(--light);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--dark);
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 25px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--dark);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .subscription-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px;
    }

    .navbar-brand h1 {
        font-size: 1.3em;
    }

    .main-content {
        padding: 15px;
    }

    .content-area {
        padding: 20px;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .videos-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
    }

    .search-input {
        width: 100% !;
    }

    .admin-tabs {
        overflow-x: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Resize buttons in header actions for mobile */
    .header-actions .btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}

/* Fix for long video/playlist titles */
.modal-content h2,
.modal-body h3,
div[style*="font-size: 24px"],
div[style*="font-size: 20px"] {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-height: 3em;
    line-height: 1.5em;
}

/* --- Subscription Page Professional Styles --- */
.subscription-info {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.subscription-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.subscription-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    transform: rotate(45deg);
}

.subscription-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.status-badge.active {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.status-badge.pending,
.status-badge.expired {
    background: #f59e0b;
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.payment-history {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.payment-history h3 {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--text-light);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
}

.payment-table th {
    text-align: left;
    padding: 15px 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background-color: #4f46e5;
    /* Match card theme */
    font-weight: 600;
}

.payment-table thead tr {
    border-radius: 8px;
    overflow: hidden;
}

.payment-table thead th:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.payment-table thead th:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.payment-table td {
    padding: 15px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text);
}

.payment-table tr:last-child td {
    border-bottom: none;
}

.text-muted {
    color: #9ca3af;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .subscription-info {
        grid-template-columns: 1fr;
    }
}

/* --- Cinema Mode Styles & Utilities (Tailwind Polyfill) --- */

/* Layout */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.w-80 {
    width: 20rem;
}

.min-h-0 {
    min-height: 0;
}

.z-20 {
    z-index: 20;
}

/* Spacing */
.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-8 {
    padding: 2rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.my-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.my-4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

/* Colors & Backgrounds */
.bg-black {
    background-color: #000;
}

.bg-gray-800 {
    background-color: #1f2937;
}

.bg-gray-900 {
    background-color: #111827;
}

.text-white {
    color: #fff;
}

.text-gray-200 {
    color: #e5e7eb;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-purple-400 {
    color: #a78bfa;
}

.text-purple-500 {
    color: #8b5cf6;
}

.text-purple-600 {
    color: #7c3aed;
}

.bg-purple-600 {
    background-color: #7c3aed;
}

.border-gray-700 {
    border-color: #374151;
}

.border-gray-800 {
    border-color: #1f2937;
}

/* Typography */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.italic {
    font-style: italic;
}

.text-center {
    text-align: center;
}

.select-all {
    user-select: all;
}

/* Borders & Rounded */
.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

.rounded-br-none {
    border-bottom-right-radius: 0;
}

.rounded-bl-none {
    border-bottom-left-radius: 0;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.border-b {
    border-bottom-width: 1px;
    border-style: solid;
}

.border-t {
    border-top-width: 1px;
    border-style: solid;
}

.border-l {
    border-left-width: 1px;
    border-style: solid;
}

.border-b-2 {
    border-bottom-width: 2px;
}

/* Effects & Others */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.transition {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 150ms;
}

.hover\:bg-gray-700:hover {
    background-color: #374151;
}

.hover\:bg-purple-700:hover {
    background-color: #6d28d9;
}

.hover\:text-purple-300:hover {
    color: #d8b4fe;
}

.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Gradient Text */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

.text-transparent {
    color: transparent;
}

.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-purple-400 {
    --tw-gradient-from: #a78bfa;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(167, 139, 250, 0));
}

.to-pink-600 {
    --tw-gradient-to: #db2777;
}

/* Specific Cinema Fixes */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1f2937;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

/* Fullscreen adjustments */
:fullscreen #cinemaView {
    height: 100vh !important;
    padding: 0;
    margin: 0;
    max-width: none;
    background: black;
}

/* Mobile Responsive Cinema Mode */
@media (max-width: 768px) {

    /* Stack player and chat vertically on mobile */
    #cinemaContentContainer {
        flex-direction: column !important;
        overflow: visible !important;
    }

    /* Make player take 45% of screen height on mobile (Balanced) */
    #cinemaPlayerArea {
        min-height: 45vh !important;
        max-height: 45vh !important;
        flex: 0 0 45vh !important;
    }

    /* Make chat sidebar take REMAINING height */
    #cinemaSidebar {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: 1 !important;
        border-left: none !important;
        border-top: 2px solid #374151 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Make chat messages flexible to fill sidebar */
    #cinemaChatMessages {
        flex: 1 !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: auto !important;
        display: block !important;
        background: #1f2937 !important;
    }

    /* --- Friends Tab Layout --- */
    .friends-layout {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 20px;
        height: calc(100vh - 250px);
    }

    .friends-list {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 15px;
        overflow-y: auto;
        background: white;
    }

    .chat-area {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        background: white;
    }

    @media (max-width: 768px) {
        .friends-layout {
            display: flex !important;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            gap: 15px;
            padding-bottom: 5px;
            /* Visual cue */
        }

        .friends-list {
            min-width: 90vw;
            width: 90vw;
            scroll-snap-align: start;
            border-right: 1px solid #e5e7eb;
        }

        .chat-area {
            min-width: 90vw;
            width: 90vw;
            scroll-snap-align: start;
        }
    }

    /* Ensure chat form is visible and at bottom */
    #cinemaChatForm {
        display: flex !important;
        flex-shrink: 0 !important;
        position: relative !important;
        z-index: 100 !important;
        background: #1f2937 !important;
        padding: 0.5rem !important;
        min-height: 60px !important;
    }

    /* Force input and button visibility */
    #cinemaChatInput,
    #cinemaChatForm button {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #cinemaChatForm button {
        display: flex !important;
    }

    /* Hide room info text on mobile to save space */
    #cinemaRoomInfo span {
        display: none;
    }

    /* Make fullscreen button more prominent on mobile */
    #cinemaView .bg-black.p-2 {
        padding: 0.5rem !important;
    }

    /* Adjust setup container for mobile */
    #cinemaSetupContainer {
        padding: 1rem !important;
        max-width: 100% !important;
    }

    /* Smaller text on mobile */
    #cinemaSetupContainer h2 {
        font-size: 1.5rem !important;
    }
}

/* Fullscreen: Hide chat and show only video */
:fullscreen #cinemaSidebar,
:-webkit-full-screen #cinemaSidebar,
:-moz-full-screen #cinemaSidebar {
    display: none !important;
}

:fullscreen #cinemaPlayerArea,
:-webkit-full-screen #cinemaPlayerArea,
:-moz-full-screen #cinemaPlayerArea {
    min-height: 100vh !important;
    max-height: 100vh !important;
    flex: 1 !important;
}

/* System Alert Banner */
.system-alert-banner {
    display: inline-block;
    margin-left: 20px;
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    animation: blink 1.5s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

.watch-party-controls button:hover {
    transform: scale(1.05);
}

/* Playlist Creation Modal - Clean Modern Design */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Playlists Modal - Clean Premium Design
   ========================================================================== */

/* Main Overlay */
.modal-clean-layout {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(9, 9, 11, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-clean-layout.hidden {
    display: none !important;
}

/* Modal Content Container */
.modal-clean-layout .modal-content-wrapper {
    background: #ffffff;
    width: 95%;
    max-width: 1100px;
    height: 85vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header */
.modal-clean-layout .modal-header-custom {
    padding: 24px 32px;
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-clean-layout .header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-clean-layout .header-title i {
    font-size: 24px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-clean-layout .header-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.025em;
}

.modal-clean-layout .btn-close-custom {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-clean-layout .btn-close-custom:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Body Layout */
.modal-clean-layout .modal-body-custom {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #f9fafb;
}

/* --- Left Panel (Form & Search) --- */
.modal-clean-layout .panel-left {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Input Groups */
.modal-clean-layout .input-group {
    margin-bottom: 20px;
}

.modal-clean-layout .input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.modal-clean-layout .input-group label .optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.85rem;
    margin-left: 4px;
}

.modal-clean-layout input[type="text"],
.modal-clean-layout textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 0.95rem;
    color: #111827;
    transition: all 0.2s;
    outline: none;
}

.modal-clean-layout textarea {
    height: 100px;
    resize: none;
    line-height: 1.5;
}

.modal-clean-layout input:focus,
.modal-clean-layout textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Search Section */
.modal-clean-layout .search-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Section Controls */
.modal-clean-layout .search-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-clean-layout .search-box {
    position: relative;
    flex: 1;
    margin-bottom: 0;
}

.modal-clean-layout .category-select {
    width: 160px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.modal-clean-layout .category-select:focus {
    border-color: #6366f1;
}

.modal-clean-layout .search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.modal-clean-layout .search-box input {
    padding-left: 44px;
    background: #f9fafb;
    border-color: #f3f4f6;
}

.modal-clean-layout .search-box input:focus {
    background: #fff;
    border-color: #6366f1;
}

/* Search Grid Layout */
.modal-clean-layout .search-results-grid {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    background: #fff;
}

.modal-clean-layout .video-card-mini {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.modal-clean-layout .video-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #e5e7eb;
}

.modal-clean-layout .empty-state-small {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* --- Right Panel (Selected) --- */
.modal-clean-layout .panel-right {
    flex: 1;
    background: #f8fafc;
    padding: 32px;
    display: flex;
    flex-direction: column;
    min-width: 380px;
    /* Ensure decent width on desktop */
}

.modal-clean-layout .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-clean-layout .panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-clean-layout .badge-count {
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.modal-clean-layout .selected-videos-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    min-height: 200px;
}

/* Empty State Large */
.modal-clean-layout .empty-state-large {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 40px;
}

.modal-clean-layout .empty-state-large .icon-circle {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-clean-layout .empty-state-large i {
    font-size: 24px;
    color: #cbd5e1;
}

.modal-clean-layout .empty-title {
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.modal-clean-layout .empty-subtitle {
    font-size: 0.9rem;
}

/* Footer */
.modal-clean-layout .modal-footer-custom {
    padding: 24px 32px;
    background: #ffffff;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-clean-layout .btn-cancel-custom {
    padding: 12px 24px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-clean-layout .btn-cancel-custom:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.modal-clean-layout .btn-save-custom {
    padding: 12px 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.modal-clean-layout .btn-save-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.modal-clean-layout .btn-save-custom:active {
    transform: translateY(0);
}

/* Keyframes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-clean-layout .modal-content-wrapper {
        height: 100%;
        max-height: 100%;
        width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-clean-layout .modal-body-custom {
        flex-direction: column;
        overflow-y: auto;
        /* Scroll entire body on mobile */
    }

    .modal-clean-layout .panel-left,
    .modal-clean-layout .panel-right {
        overflow-y: visible;
        /* Let body handle scroll */
        flex: none;
        /* Auto height based on content */
        padding: 20px;
        border-right: none;
        min-width: 0;
    }

    .modal-clean-layout .panel-right {
        background: #f1f5f9;
        border-top: 1px solid #e2e8f0;
    }

    .modal-clean-layout .search-results-grid {
        max-height: 250px;
        /* Limit height on mobile */
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .modal-clean-layout .search-controls {
        flex-direction: column;
        gap: 8px;
    }

    .modal-clean-layout .category-select {
        width: 100%;
        padding: 10px;
    }
}

.system-alert-banner.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .system-alert-banner {
        display: block;
        margin-left: 0;
        margin-top: 10px;
        font-size: 0.85em;
    }

    .navbar-brand {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

/* --- Fix Playlist Card Alignment (Enforced) --- */
.playlist-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 320px;
    /* Ensure visual balance */
}

.playlist-card .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    /* Ensuring padding */
}

.playlist-card .video-title {
    margin-bottom: 8px;
    /* Spacing */
    flex-shrink: 0;
}

.playlist-card .video-description {
    flex: 1;
    /* Allow description to take space but not push too much */
}

.playlist-card .video-actions {
    margin-top: auto !important;
    /* Force to bottom */
    width: 100%;
}

.playlist-card .video-thumbnail {
    border-radius: 12px;
    overflow: hidden;
}

/* --- Fix Video Card Alignment & Styling (Enforced) --- */
.video-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 340px;
    /* Consistent height */
    position: relative;
    /* For overlays if needed */
}

.video-card .video-thumbnail {
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.video-card .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.video-card .video-title {
    margin-bottom: 8px;
    line-height: 1.4;
    max-height: 2.8em;
    /* restrict height */
}

.video-card .video-actions {
    margin-top: auto !important;
    width: 100%;
    display: flex;
    gap: 8px;
    padding-top: 10px;
}

/* --- Commercial Cinema Layout --- */
.commercial-cinema-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding-bottom: 20px;
    overflow-x: auto;
}

.movie-poster-card {
    background: #1f2937;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
}

.movie-poster-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: #6366f1;
}

.poster-image-container {
    aspect-ratio: 2/3;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.poster-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-poster-card:hover .poster-image-container img {
    transform: scale(1.05);
}

.rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fbbf24;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8rem;
    border: 1px solid #fbbf24;
}

.movie-info-bottom {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.movie-title-card {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.tag-badge {
    font-size: 0.65rem;
    background: #374151;
    color: #9ca3af;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ticket-btn-container {
    margin-top: auto;
}

.ticket-btn {
    width: 100%;
    padding: 8px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid transparent;
}

.ticket-btn:hover {
    background: #e5e7eb;
    transform: scale(1.02);
}

/* Schedule Table */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.schedule-slot {
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    background: #f0f9ff;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-slot:hover {
    background: #dbeafe;
    transform: translateY(-2px);
}

.schedule-slot.sold-out {
    border-color: #ef4444;
    background: #fef2f2;
    opacity: 0.8;
    cursor: not-allowed;
}

.slot-time {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.slot-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
}

.schedule-slot.sold-out .slot-time {
    color: #991b1b;
}

.schedule-slot.sold-out .slot-status {
    color: #dc2626;
}

@media (max-width: 768px) {
    .commercial-cinema-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar Utilities */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

/* Animation Utilities */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Plan Selection Cards */
.plan-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.plan-card.recommended {
    border-color: #667eea;
    border-width: 3px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
}

.plan-card.recommended::before {
    content: "RECOMENDADO";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.plan-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    line-height: 1;
}

.plan-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1f2937;
}

.plan-price {
    font-size: 2.5em;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 8px;
    line-height: 1;
}

.plan-price small {
    font-size: 0.35em;
    color: #9ca3af;
    font-weight: 500;
}

.plan-description {
    color: #6b7280;
    font-size: 0.95em;
    margin-bottom: 20px;
    min-height: 40px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
    font-size: 0.9em;
    flex: 1;
}

.plan-features li {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    display: flex;
    align-items: flex-start;
    line-height: 1.5;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li::before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 10px;
    flex-shrink: 0;
}

.plan-card .btn {
    width: 100%;
    margin-top: auto;
    padding: 14px 24px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 10px;
}

.plan-card.recommended .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.plan-card.recommended .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

@media (max-width: 768px) {
    #planCardsGrid {
        grid-template-columns: 1fr !important;
    }

    .plan-card {
        padding: 15px;
    }
}

/* Status Badge Styles */
.status-badge.warning {
    background: #f59e0b;
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.status-badge.inactive {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Custom Scrollbar for Modal Gallery */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}
/* Language Flags */
.flag-icon-glossy {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.5);
}

.flag-icon-glossy:hover {
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* FIX MODAL SCROLLING & LAYOUT */
.modal-content { display: flex !important; flex-direction: column !important; max-height: 90vh !important; overflow: hidden !important; width: 95% !important; margin: auto !important; }
.modal-body { overflow-y: auto !important; flex: 1 !important; padding: 20px !important; }
.modal-header { flex-shrink: 0 !important; }
