/*
Theme Name: Super Stream
Description: A custom WordPress theme with full user management system
Version: 1.0
Author: Super Stream Team
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937 !important;
    background-color: #f9fafb !important;
}

/* Force white background for WordPress admin */
.wp-admin, .wp-admin body, #wpbody, #wpbody-content, #wpwrap {
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

/* Force white background for admin pages */
.wrap, .card, .notice {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

/* Light theme variables */
:root {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e5e7eb;
}

/* Utility classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

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

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

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

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

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

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

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

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Card styles */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

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

.table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-blocked {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-expired {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

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

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Sidebar styles */
.sidebar {
    width: 250px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 0;
    box-shadow: 2px 0 4px 0 rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Main content */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

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

/* Search and filter */
.search-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 150px;
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}

.mobile-menu-toggle:hover {
    background: var(--accent-hover);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

.mobile-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    min-height: 44px;
    min-width: 44px;
}

.sidebar-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-close {
        display: block;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .search-filter {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 0.5rem;
        background-color: #ffffff !important;
        border: 1px solid #e5e7eb !important;
    }
    
    .header h2 {
        font-size: 1.5rem;
        color: #1f2937 !important;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dashboard-stats .card {
        text-align: center;
        background-color: #ffffff !important;
        border: 1px solid #e5e7eb !important;
    }
    
    .dashboard-stats .card p {
        font-size: 1.5rem !important;
        color: #1f2937 !important;
    }
    
    .dashboard-stats .card h3 {
        color: #1f2937 !important;
    }
    
    /* Table responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background-color: #ffffff !important;
    }
    
    .table {
        min-width: 600px;
        font-size: 0.875rem;
        background-color: #ffffff !important;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        background-color: #ffffff !important;
        color: #1f2937 !important;
        border-color: #e5e7eb !important;
    }
    
    .table th {
        background-color: #f3f4f6 !important;
        color: #1f2937 !important;
    }
    
    /* Button responsive */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Modal responsive */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        padding: 1rem;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
    
    /* Form responsive */
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-input,
    .form-select {
        padding: 0.625rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Status badges */
    .status-badge {
        padding: 0.125rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.25rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .header h2 {
        font-size: 1.25rem;
    }
    
    .dashboard-stats .card p {
        font-size: 1.25rem !important;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    
    .search-filter {
        gap: 5px;
    }
    
    .search-filter .btn {
        width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
    
    .sidebar-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .table tbody tr {
        min-height: 44px;
    }
    
    .modal-close {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Additional mobile improvements */
@media (max-width: 768px) {
    /* Force white background and proper mobile layout */
    body, html {
        background-color: #f9fafb !important;
        color: #1f2937 !important;
        overflow-x: auto !important;
        width: 100% !important;
    }
    
    /* Fix WordPress admin mobile layout */
    #wpbody, #wpbody-content, #wpwrap, .wp-admin {
        background-color: #f9fafb !important;
        color: #1f2937 !important;
        width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* Improve touch targets */
    .btn, .form-input, .form-select {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        background-color: #ffffff !important;
        color: #1f2937 !important;
        border: 1px solid #e5e7eb !important;
    }
    
    /* Better form spacing */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Improve table scrolling */
    .table-container {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        background-color: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px;
        overflow-x: auto !important;
    }
    
    .table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #3b82f6;
        border-radius: 4px;
    }
    
    /* Mobile-specific button styles */
    .btn {
        -webkit-appearance: none;
        border-radius: 6px;
        font-weight: 500;
        text-align: center;
        transition: all 0.2s ease;
        background-color: #3b82f6 !important;
        color: #ffffff !important;
        border: none !important;
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .btn-secondary {
        background-color: #f3f4f6 !important;
        color: #1f2937 !important;
        border: 1px solid #e5e7eb !important;
    }
    
    .btn-success {
        background-color: #10b981 !important;
        color: #ffffff !important;
    }
    
    .btn-warning {
        background-color: #f59e0b !important;
        color: #ffffff !important;
    }
    
    .btn-danger {
        background-color: #ef4444 !important;
        color: #ffffff !important;
    }
    
    /* Improve modal on mobile */
    .modal {
        padding: 10px;
        background-color: rgba(0, 0, 0, 0.5) !important;
    }
    
    .modal-content {
        border-radius: 8px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        background-color: #ffffff !important;
        color: #1f2937 !important;
    }
    
    /* Better status badges on mobile */
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
    }
    
    .status-active {
        background-color: rgba(16, 185, 129, 0.1) !important;
        color: #10b981 !important;
    }
    
    .status-blocked {
        background-color: rgba(239, 68, 68, 0.1) !important;
        color: #ef4444 !important;
    }
    
    .status-expired {
        background-color: rgba(245, 158, 11, 0.1) !important;
        color: #f59e0b !important;
    }
    
    /* Fix search and filter section */
    .search-filter {
        background-color: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .search-input, .filter-select {
        background-color: #ffffff !important;
        color: #1f2937 !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 6px;
        padding: 12px;
        font-size: 16px;
    }
    
    /* Fix page title */
    .wrap h1 {
        color: #1f2937 !important;
        background-color: #ffffff !important;
        padding: 1rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb !important;
        margin-bottom: 1rem;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .card {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
        font-size: 0.7rem;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

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

/* Alert messages */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}
