/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme variables */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-light: 0 25px 50px rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.2);
    --accent-color: #667eea;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --input-bg: rgba(255, 255, 255, 0.8);
    --card-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: rgba(30, 30, 46, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #888;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 25px 50px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.5);
    --accent-color: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --glass-bg: rgba(30, 30, 46, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(40, 40, 60, 0.8);
    --card-bg: rgba(30, 30, 46, 0.95);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.nav-brand i {
    font-size: 2rem;
    color: #ff6b6b;
}

.nav-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

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

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item i {
    margin-right: 8px;
    color: #ff6b6b;
}

/* Featured Stream */
.featured-section {
    margin-bottom: 3rem;
}

.featured-section h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.featured-stream {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: white;
}

.stream-placeholder {
    padding: 2rem;
}

.stream-placeholder i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

/* Streams Section */
.streams-section h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filters select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.filters select option {
    background: #333;
    color: white;
}

/* Streams Grid */
.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stream-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.stream-thumbnail {
    height: 200px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stream-thumbnail i {
    font-size: 3rem;
    color: white;
    opacity: 0.7;
}

.live-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4757;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: livePulse 2s infinite;
}

.live-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    animation: liveDot 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes liveDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.stream-info {
    padding: 1rem;
    color: white;
}

.stream-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stream-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stream-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category {
    background: rgba(255, 107, 107, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid #ff6b6b;
}

.viewers {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: white;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

/* Form Styles */
.create-stream-form {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group select option {
    background: #333;
    color: white;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Stream Details */
.stream-details {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stream-details h3 {
    color: #4ecdc4;
    margin-bottom: 1.5rem;
    text-align: center;
}

.details-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 500;
}

.copy-field {
    display: flex;
    gap: 10px;
}

.copy-field input {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.copy-btn {
    background: #4ecdc4;
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #45b7b8;
}

.streaming-instructions {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    color: white;
}

.streaming-instructions h4 {
    margin-bottom: 1rem;
    color: #4ecdc4;
}

.streaming-instructions ol {
    padding-left: 1.5rem;
}

.streaming-instructions li {
    margin-bottom: 0.5rem;
}

.streaming-instructions code {
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: #4ecdc4;
}

/* Upload Form Styles */
.upload-form {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.file-input-display {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.file-input-display:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.file-input-display.file-selected {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.file-input-display i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.file-input-display span {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.file-input-display small {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Upload Progress */
.upload-progress {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: 2rem;
    color: white;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Upload Success */
.upload-success {
    text-align: center;
    padding: 2rem;
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 10px;
    margin-top: 2rem;
    color: white;
}

.upload-success h3 {
    color: #4ecdc4;
    margin-bottom: 1rem;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.upload-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: white;
    font-size: 1.2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4ecdc4;
}

.status-indicator.offline {
    color: #ff6b6b;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-indicator.offline::before {
    animation: none;
    opacity: 0.7;
}

.card-content {
    padding: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: white;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.activity-list {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    color: white;
    opacity: 0.8;
}

.activity-item i {
    color: #4ecdc4;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
    color: white;
}

.video-container {
    position: relative;
    margin-bottom: 1rem;
}

.video-container video {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 10px;
}

.video-placeholder {
    display: none;
    text-align: center;
    padding: 3rem;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}

.video-placeholder i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

/* Enhanced Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 350px;
    box-shadow: var(--shadow-light);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

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

.toast.success::before {
    background: #4ecdc4;
}

.toast.error::before {
    background: #ff6b6b;
}

.toast.info::before {
    background: #3498db;
}

.toast.warning::before {
    background: #f39c12;
}

.toast i {
    font-size: 1.1rem;
    opacity: 0.9;
}

.toast.success i {
    color: #4ecdc4;
}

.toast.error i {
    color: #ff6b6b;
}

.toast.info i {
    color: #3498db;
}

.toast.warning i {
    color: #f39c12;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Toast animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

.toast.entering {
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.exiting {
    animation: toastSlideOut 0.3s ease-in-out;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .usage-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-menu {
        order: 1;
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .user-menu {
        order: -1;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Better navigation scrolling */
    .nav-menu {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .user-menu {
        order: 2;
    }
    
    .nav-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .tenant-info {
        display: none;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-card.featured {
        transform: none;
        order: -1;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 15px;
    }
    
    .nav-brand {
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-brand h1 {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.8rem;
        padding: 10px 8px;
    }
    
    .nav-btn i {
        display: none;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .stat-item {
        min-width: 200px;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .streams-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .filters select {
        width: 100%;
        max-width: 200px;
    }
    
    .create-stream-form,
    .upload-form {
        padding: 1.5rem;
        margin: 0 -15px;
    }
    
    .usage-stats {
        grid-template-columns: 1fr;
    }
    
    .metric-row {
        grid-template-columns: 1fr;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-actions {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .alert-content {
        padding: 1rem;
    }
    
    .copy-field {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .copy-btn {
        align-self: flex-start;
    }
    
    /* Additional mobile improvements */
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .card {
        margin: 0.5rem 0;
        padding: 1rem;
    }
    
    .content-section {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    /* Better table mobile experience */
    .table-container {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .header .container {
        padding: 0.75rem 10px;
    }
    
    .nav-brand h1 {
        font-size: 1.2rem;
    }
    
    .nav-brand i {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-btn {
        flex: none;
        min-width: 80px;
        font-size: 0.75rem;
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    .page-header {
        margin-bottom: 2rem;
    }
    
    .page-header h2 {
        font-size: 1.75rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .create-stream-form,
    .upload-form {
        padding: 1rem;
        margin: 0 -10px;
        border-radius: 15px;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .stream-card {
        margin: 0 -10px;
    }
    
    .featured-stream {
        margin: 0 -10px;
    }
    
    .usage-card,
    .analytics-card,
    .settings-card,
    .current-plan-card,
    .dashboard-card,
    .users-table-container,
    .billing-history {
        margin: 0 -10px;
        border-radius: 15px;
    }
    
    .plan-card {
        padding: 1.5rem 1rem;
    }
    
    .plan-card .plan-price {
        font-size: 2rem;
    }
    
    .usage-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stat-value span:first-child {
        font-size: 1.5rem;
    }
    
    .usage-alert {
        margin: 0 -10px 2rem -10px;
    }
    
    .alert-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .users-table,
    .billing-table {
        font-size: 0.85rem;
    }
    
    .users-table th,
    .users-table td,
    .billing-table th,
    .billing-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .file-input-display {
        padding: 1.5rem 1rem;
    }
    
    .file-input-display i {
        font-size: 1.5rem;
    }
    
    .toast {
        max-width: calc(100vw - 40px);
        margin-right: 20px;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
}

/* Enhanced Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, rgba(255,255,255,0.1) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

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

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Enhanced Form Validation */
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group.has-success input,
.form-group.has-success textarea,
.form-group.has-success select {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-error i {
    font-size: 0.8rem;
}

.form-success {
    color: #27ae60;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-success i {
    font-size: 0.8rem;
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    margin-bottom: 5px;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* Progress Indicators */
.progress-ring {
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 4;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-circle.active {
    stroke: var(--accent-color);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.fab:active {
    transform: scale(0.95);
}

/* Contextual Menu */
.context-menu {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    padding: 0.5rem 0;
    min-width: 150px;
    z-index: 2000;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s ease;
    pointer-events: none;
}

.context-menu.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item i {
    font-size: 0.85rem;
    width: 16px;
    color: var(--text-secondary);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Authentication Styles */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    z-index: 1000;
    overflow-y: auto;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--shadow-light);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--glass-border);
    margin: auto;
    position: relative;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.theme-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.theme-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    background: var(--card-bg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.auth-header h1 i {
    color: var(--accent-color);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 5px;
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
}

.subdomain-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    overflow: hidden;
}

.subdomain-input input {
    border: none;
    background: transparent;
    flex: 1;
    color: var(--text-primary);
}

.subdomain-input span {
    padding: 12px 15px;
    background: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    justify-content: center;
    min-height: 48px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--card-bg);
    transform: translateY(-1px);
}

.auth-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #e74c3c;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

.input.valid {
    border-color: #27ae60;
}

.input.invalid {
    border-color: #e74c3c;
}

/* Enhanced Analytics Styles */
.usage-overview {
    margin-bottom: 2rem;
}

.usage-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.usage-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0;
}

.usage-period {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--input-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.usage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.usage-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.usage-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-value span:first-child {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-limit {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.stat-progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.8s ease;
    position: relative;
}

.stat-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.analytics-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.analytics-card .card-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-card .card-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0;
}

.analytics-card .card-header select {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.analytics-card .card-content {
    padding: 1.5rem;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.metric:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.metric-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.chart-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.top-streams-list {
    min-height: 250px;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.no-data i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

/* Enhanced Table Styles */
.users-table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.users-table th {
    padding: 1.5rem 1rem;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.users-table td {
    padding: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.users-table tbody tr {
    transition: all 0.3s ease;
}

.users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.loading-row {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.loading-row i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

/* Enhanced Billing Styles */
.billing-section {
    margin-bottom: 3rem;
}

.current-plan-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.current-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.plan-info h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-name {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.plan-price {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.plan-status .status-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.plan-features .feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.plan-features .feature i {
    color: var(--accent-color);
    font-size: 0.8rem;
}

.plan-actions {
    display: flex;
    gap: 1rem;
}

.billing-history {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.billing-table th,
.billing-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.billing-table th {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.billing-table td {
    color: var(--text-primary);
}

.billing-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* SaaS-specific styles */
.tenant-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 15px;
    font-size: 0.85rem;
}

.plan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 2px;
}

.plan-free {
    background: #95a5a6;
    color: white;
}

.plan-starter {
    background: #3498db;
    color: white;
}

.plan-professional {
    background: #e67e22;
    color: white;
}

.plan-business {
    background: #8e44ad;
    color: white;
}

.plan-enterprise {
    background: #2c3e50;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
    }
    
    .auth-card {
        padding: 32px 24px;
        margin: 0;
        max-width: 100%;
        border-radius: 20px;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
    }
    
    .theme-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .auth-header h1 {
        font-size: 2rem;
        gap: 10px;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 15px;
    }
    
    .subdomain-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .subdomain-input input {
        padding: 12px 15px;
    }
    
    .subdomain-input span {
        border-left: none;
        border-top: 1px solid var(--border-color);
        text-align: center;
        padding: 10px 15px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .auth-tabs {
        margin-bottom: 25px;
    }
    
    .auth-tab {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}

/* Enhanced Settings Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.settings-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.settings-card .card-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-card .card-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0;
}

.feature-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-card .card-content {
    padding: 1.5rem;
}

.subdomain-display {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.subdomain-display span:first-child {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.subdomain-display span:last-child {
    padding: 12px 15px;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-color);
}

.url-display {
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.api-keys-list {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: auto;
}

/* Enhanced Modal Styles */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.plan-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
}

.plan-card.featured {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.plan-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.plan-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-card .plan-name {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.plan-card .plan-price {
    color: var(--accent-color);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.plan-card .plan-price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.plan-card .plan-features {
    margin-bottom: 2rem;
    text-align: left;
}

.plan-card .feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.plan-card .feature i {
    color: var(--accent-color);
    font-size: 0.8rem;
    width: 16px;
}

.select-plan {
    width: 100%;
    margin-top: 1rem;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.permission-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

.permission-item input[type="checkbox"] {
    margin: 0;
    accent-color: var(--accent-color);
}

.permission-item span {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Enhanced Usage Alert */
.usage-alert {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 165, 0, 0.1));
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 15px;
    margin-bottom: 2rem;
    overflow: hidden;
    animation: slideDown 0.5s ease-out;
}

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

.alert-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
}

.alert-content i {
    color: #ff6b6b;
    font-size: 1.2rem;
}

.alert-content span {
    flex: 1;
    font-weight: 500;
}

.btn-small.btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 20px;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .usage-stats {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-row {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-card.featured {
        transform: none;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-actions {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .alert-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .main-content {
        padding: 0.75rem 0;
    }
    
    .header .container {
        padding: 0.5rem 8px;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav-brand {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .nav-brand h1 {
        font-size: 1.5rem;
    }
    
    .tenant-info {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.85rem;
    }
    
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-width: auto;
        white-space: nowrap;
    }
    
    .nav-btn i {
        font-size: 1rem;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .user-info span {
        font-size: 0.9rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .page-header h2 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    .stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .stat-item {
        font-size: 0.85rem;
    }
    
    .streams-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stream-card {
        margin: 0 -8px;
        border-radius: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    
    .btn {
        padding: 16px 24px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 52px;
        border-radius: 8px;
    }
    
    .btn i {
        font-size: 1rem;
    }
    
    .copy-field {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .copy-field input {
        margin-bottom: 0;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .file-input-display {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .file-input-display i {
        font-size: 2.5rem;
    }
    
    .upload-progress {
        margin: 1rem -8px;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .usage-card,
    .analytics-card,
    .settings-card,
    .current-plan-card {
        margin: 0 -8px;
        border-radius: 15px;
        padding: 1.5rem;
    }
    
    .usage-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .usage-header h3 {
        font-size: 1.25rem;
    }
    
    .usage-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .usage-stat {
        padding: 1rem;
    }
    
    .stat-value span:first-child {
        font-size: 1.5rem;
    }
    
    .analytics-card .card-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .analytics-card .card-content {
        padding: 1rem;
    }
    
    .chart-container {
        min-height: 200px;
    }
    
    .users-table-container {
        margin: 0 -8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .users-table {
        min-width: 600px;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .billing-section {
        margin: 0 -8px;
    }
    
    .current-plan-card {
        padding: 1.5rem;
    }
    
    .plan-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .plan-info h3 {
        font-size: 1.25rem;
    }
    
    .plan-name {
        font-size: 1.5rem;
    }
    
    .plan-price {
        font-size: 2rem;
    }
    
    .plan-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .billing-table {
        min-width: 500px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .settings-card {
        margin: 0 -8px;
        padding: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .subdomain-display {
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .url-display {
        font-size: 0.85rem;
        word-break: break-all;
        text-align: center;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .video-container {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .stream-info {
        margin-top: 1rem;
    }
    
    .stream-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .plan-card {
        padding: 1.5rem;
        margin: 0;
    }
    
    .plan-card.featured {
        transform: none;
        order: -1;
    }
    
    .plan-name {
        font-size: 1.25rem;
    }
    
    .plan-price {
        font-size: 2rem;
    }
    
    .plan-features {
        margin-bottom: 1.5rem;
    }
    
    .feature {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .permission-item {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .alert-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    .alert-content span {
        font-size: 0.9rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .auth-header h1 i {
        font-size: 2rem;
    }
    
    .subdomain-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .subdomain-input span {
        border-left: none;
        border-top: 1px solid var(--border-color);
        text-align: center;
    }
    
    .auth-tabs {
        margin-bottom: 1.5rem;
    }
    
    .auth-tab {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Enhanced Stream Card Interactions */
.stream-card {
    position: relative;
    overflow: hidden;
}

.stream-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.stream-card:hover::before {
    left: 100%;
}

.stream-card .stream-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.stream-card:hover .stream-overlay {
    opacity: 1;
}

.stream-play-btn {
    background: var(--accent-gradient);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stream-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/* Enhanced Video Player */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.video-container:hover .video-controls {
    transform: translateY(0);
}

.video-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-bottom: 1rem;
    cursor: pointer;
}

.video-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.1s ease;
}

.video-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.video-btn:hover {
    color: var(--accent-color);
}

/* Drag and Drop Enhancement */
.file-input-display.drag-over {
    border-color: var(--accent-color);
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.file-input-display.drag-over i {
    color: var(--accent-color);
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Enhanced Search */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Enhanced Micro-interactions */
.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transition: left 0.3s ease;
}

.nav-btn.active::before,
.nav-btn:hover::before {
    left: 0;
}

/* Form Focus Enhancements */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    transform: translateY(-1px);
}

/* Custom Scrollbars */
.streams-grid::-webkit-scrollbar,
.activity-list::-webkit-scrollbar {
    width: 6px;
}

.streams-grid::-webkit-scrollbar-track,
.activity-list::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.streams-grid::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.streams-grid::-webkit-scrollbar-thumb:hover,
.activity-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Indicators */
.nav-btn:focus,
.btn:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
        --text-muted: #333;
    }
    
    [data-theme="dark"] {
        --border-color: #fff;
        --text-secondary: #fff;
        --text-muted: #ccc;
    }
}