/**
 * CableStock Premium Theme
 * Shared styles for a cohesive, premium SaaS experience
 * Include this after app.css in all app pages
 */

/* =====================================================
   PAGE BACKGROUND
   ===================================================== */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, #e2e8f0 1px, transparent 0);
    background-size: 32px 32px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.main-content {
    position: relative;
    z-index: 1;
}

/* =====================================================
   ENHANCED HEADER
   ===================================================== */
.app-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    color: #111827 !important;
}

#logout-btn {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    transition: all 0.2s ease !important;
}

#logout-btn:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   ENHANCED SIDEBAR
   ===================================================== */
.sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-right: none !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
    padding: 8px;
}

.nav-item {
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: 10px !important;
    margin-bottom: 4px;
    padding: 12px 16px !important;
    transition: all 0.2s ease !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.nav-item.active:hover {
    transform: translateX(0);
}

.nav-icon {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* =====================================================
   PAGE HEADER (Premium Banner Style)
   ===================================================== */
.page-header {
    background: linear-gradient(135deg, #2563EB 0%, #1e40af 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.1) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: white;
    position: relative;
    z-index: 1;
}

.page-header p,
.page-header .text-light {
    margin: 0;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.page-header .header-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Header Action Buttons */
.page-header .btn-primary,
.page-header .btn {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1e40af !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.page-header .btn:hover {
    background: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

.page-header .btn-secondary {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
}

.page-header .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* =====================================================
   FADE-IN ANIMATIONS
   ===================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    animation: fadeInUp 0.5s ease-out;
}

.card,
.filters-bar,
.report-filters,
.pricing-grid {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

/* =====================================================
   ENHANCED CARDS
   ===================================================== */
.card {
    background: white;
    border-radius: 16px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
    border: none !important;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #2563EB 0%, #1d4ed8 100%);
}

.card-header h3,
.card-header .card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.card-body {
    padding: 20px 24px;
}

/* =====================================================
   ENHANCED FILTER BAR
   ===================================================== */
.filters-bar {
    background: white;
    border-radius: 16px !important;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.filters-bar .filters-row,
.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filters-bar .form-input,
.filter-group .form-input {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filters-bar .form-input:focus,
.filter-group .form-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* =====================================================
   ENHANCED TABLES
   ===================================================== */
.data-table,
.report-table,
.materials-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.report-table th,
.materials-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td,
.report-table td,
.materials-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #374151;
}

.data-table tbody tr,
.report-table tbody tr,
.materials-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover,
.report-table tbody tr:hover,
.materials-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

.data-table tbody tr:nth-child(even),
.report-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.01);
}

.data-table tbody tr:nth-child(even):hover,
.report-table tbody tr:nth-child(even):hover {
    background: rgba(37, 99, 235, 0.03);
}

/* =====================================================
   ENHANCED BUTTONS
   ===================================================== */
.btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    padding: 10px 18px !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    padding: 10px 18px !important;
    transition: all 0.2s ease !important;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #16A34A 0%, #15803d 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

/* =====================================================
   ENHANCED MODALS
   ===================================================== */
.modal-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal {
    border-radius: 20px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
    border: none !important;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f3f4f6;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =====================================================
   ENHANCED FORM INPUTS
   ===================================================== */
.form-input,
.form-input:not([type="checkbox"]):not([type="radio"]) {
    border-radius: 10px !important;
    border: 1px solid #e5e7eb !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    background: white !important;
}

.form-input:focus {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none !important;
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.form-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* =====================================================
   ENHANCED EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    position: relative;
}

.empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, #e2e8f0 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.3;
    pointer-events: none;
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    position: relative;
    z-index: 1;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
    position: relative;
    z-index: 1;
}

/* =====================================================
   ENHANCED TABS
   ===================================================== */
.tabs,
.reels-tabs,
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    background: transparent;
}

.tab-btn,
.reels-tab,
.admin-tab {
    padding: 14px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.tab-btn:hover,
.reels-tab:hover,
.admin-tab:hover {
    color: #374151;
    background: rgba(37, 99, 235, 0.03);
}

.tab-btn.active,
.reels-tab.active,
.admin-tab.active {
    color: #2563EB;
    font-weight: 600;
}

.tab-btn.active::after,
.reels-tab.active::after,
.admin-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563EB 0%, #1d4ed8 100%);
    border-radius: 2px 2px 0 0;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    background: #e5e7eb;
    color: #6b7280;
}

.tab-btn.active .tab-count,
.reels-tab.active .tab-count {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563EB;
}

/* =====================================================
   ENHANCED STATUS BADGES
   ===================================================== */
.status-badge,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-in-stock,
.status-active,
.badge-success {
    background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
    color: #15803D;
}

.status-checked-out,
.status-pending,
.badge-warning {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #B45309;
}

.status-low-stock,
.status-denied,
.badge-danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #DC2626;
}

.status-completed,
.badge-neutral {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #4B5563;
}

/* =====================================================
   JOB CARDS (for jobs.html)
   ===================================================== */
.job-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
    padding: 20px;
    transition: all 0.25s ease;
    cursor: pointer;
    border-left: 4px solid #2563EB;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.job-card.status-active {
    border-left-color: #22C55E;
}

.job-card.status-completed {
    border-left-color: #6B7280;
}

.job-card.status-on-hold {
    border-left-color: #F59E0B;
}

/* =====================================================
   PRICING CARDS (for billing.html)
   ===================================================== */
.pricing-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    border-color: #2563EB;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px);
}

.pricing-card.popular {
    border-color: #2563EB;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */
@media (max-width: 768px) {
    .page-header {
        padding: 20px;
        border-radius: 12px;
    }

    .page-header-row {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .page-header .header-actions {
        width: 100%;
        justify-content: center;
    }

    .card {
        border-radius: 12px !important;
    }

    .card-header,
    .card-body {
        padding: 16px 20px;
    }

    .modal {
        border-radius: 16px !important;
        margin: 16px;
    }

    .filters-bar .filters-row {
        flex-direction: column;
    }

    .filters-bar .form-input,
    .filter-group {
        width: 100%;
    }
}
