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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
    padding-top: 70px; /* Account for fixed header */
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    background: linear-gradient(180deg, #1a1a1a, #2d2d2d);
    color: white;
    border-radius: 0 20px 20px 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 70px; /* Start below header */
    height: calc(100vh - 70px); /* Full height minus header */
    overflow-y: auto;
    flex-shrink: 0;
}

/* Admin Sidebar - Red Background */
.sidebar.admin-sidebar {
    background: linear-gradient(180deg, #8B0000, #DC143C);
    box-shadow: 4px 0 20px rgba(220, 20, 60, 0.3);
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
    box-sizing: border-box;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

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

.go-to-site-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Navigation Styles */
.sidebar-nav {
    padding: 1.5rem 0;
}

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

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 25px 25px 0;
    margin-right: 1rem;
    white-space: nowrap;
    min-height: 48px;
    box-sizing: border-box;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link i {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item.active .nav-link {
    background: white;
    color: #333;
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 250px;
    min-margin-left: 250px;
    background: white;
    border-radius: 20px 0 0 20px;
    min-height: 100vh;
    padding: 2rem;
    width: calc(100% - 250px);
}

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

.welcome-text {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
}

/* Statistics Dashboard */
.stats-dashboard {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 10px; /* Space for scrollbar */
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 200px;
    min-width: 180px;
}

.stat-card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #ced4da;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0;
    line-height: 1.2;
}

.stat-label {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.stat-change {
    display: none;
}

.stat-change.positive {
    background: #d4edda;
    color: #155724;
}

.stat-change.negative {
    background: #f8d7da;
    color: #721c24;
}

.page-title {
    font-size: 2rem;
    color: #333;
    font-weight: 600;
}

.search-container {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1rem;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.subscriber-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.subscriber-table th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscriber-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #333;
}

.subscriber-table tbody tr:hover {
    background: #f8f9fa;
}

/* Status Badge */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.control-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.edit-btn {
    background: #28a745;
    color: white;
}

.edit-btn:hover {
    background: #218838;
    transform: scale(1.1);
}

.view-btn {
    background: #6c757d;
    color: white;
}

.view-btn:hover {
    background: #5a6268;
    transform: scale(1.1);
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

.action-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

.action-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.action-card h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.action-card p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Payment Filters */
.payment-filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    min-width: 150px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Payment Specific Styles */
.payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.payments-table th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payments-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #333;
}

.payments-table tbody tr:hover {
    background: #f8f9fa;
}

/* Payment Status Badges */
.status-badge.completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.status-badge.refunded {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Payment Control Buttons */
.download-btn {
    background: #17a2b8;
    color: white;
}

.download-btn:hover {
    background: #138496;
    transform: scale(1.1);
}

.refund-btn {
    background: #ffc107;
    color: #212529;
}

.refund-btn:hover {
    background: #e0a800;
    transform: scale(1.1);
}

.retry-btn {
    background: #fd7e14;
    color: white;
}

.retry-btn:hover {
    background: #e8630a;
    transform: scale(1.1);
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
    transform: scale(1.1);
}

/* Payment Statistics */
.payment-stats .stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.payment-stats .stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.payment-stats .stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.payment-stats .stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.stat-change.neutral {
    background: #e2e3e5;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
    
    .search-container {
        width: 250px;
    }
    
    .payment-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .customer-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
    }
    
    .filter-select {
        min-width: 120px;
    }
}

/* Customer Management Specific Styles */
.customer-filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    flex-wrap: wrap;
}

.customers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.customers-table th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customers-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #333;
    vertical-align: middle;
}

.customers-table tbody tr:hover {
    background: #f8f9fa;
}

/* Customer Info Display */
.customer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.customer-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.customer-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.customer-company {
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

/* Customer Status Badges */
.status-badge.verified {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.suspended {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.status-badge.inactive {
    background: #e2e3e5;
    color: #495057;
    border: 1px solid #ced4da;
}

/* Customer Control Buttons */
.message-btn {
    background: #17a2b8;
    color: white;
}

.message-btn:hover {
    background: #138496;
    transform: scale(1.1);
}

.suspend-btn {
    background: #fd7e14;
    color: white;
}

.suspend-btn:hover {
    background: #e8630a;
    transform: scale(1.1);
}

.verify-btn {
    background: #28a745;
    color: white;
}

.verify-btn:hover {
    background: #218838;
    transform: scale(1.1);
}

.activate-btn {
    background: #20c997;
    color: white;
}

.activate-btn:hover {
    background: #1ea080;
    transform: scale(1.1);
}

/* Customer Statistics */
.customer-stats .stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.customer-stats .stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.customer-stats .stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.customer-stats .stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

/* File Management Specific Styles */
.file-filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    flex-wrap: wrap;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.files-table th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.files-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #333;
    vertical-align: middle;
}

.files-table tbody tr:hover {
    background: #f8f9fa;
}

/* File Info Display */
.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    width: 20px;
    font-size: 1rem;
    color: #6c757d;
    flex-shrink: 0;
}

.file-name {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    word-break: break-word;
}

.no-file {
    color: #adb5bd;
    font-style: italic;
    font-size: 0.85rem;
}

/* File Type Icons Colors */
.fa-file-image {
    color: #28a745;
}

.fa-file-pdf {
    color: #dc3545;
}

.fa-file-word {
    color: #0d6efd;
}

.fa-file-excel {
    color: #198754;
}

.fa-file-code,
.fa-file-alt {
    color: #6f42c1;
}

.fa-file-archive {
    color: #fd7e14;
}

/* File Statistics */
.file-stats .stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #6610f2, #6f42c1);
}

.file-stats .stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
}

.file-stats .stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #198754, #157347);
}

.file-stats .stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #fd7e14, #e8630a);
}

/* Saved Designs Specific Styles */
.saved-designs-filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    flex-wrap: wrap;
}

.saved-designs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.saved-designs-table th,
.saved-designs-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    text-align: left;
}

.saved-designs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.saved-designs-table tbody tr:hover {
    background: #f8f9fa;
}

/* Saved Designs Statistics */
.saved-designs-stats .stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.saved-designs-stats .stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

.saved-designs-stats .stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #20c997, #198754);
}

.saved-designs-stats .stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
}

/* Template Request Specific Styles */
.template-requests-filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    flex-wrap: wrap;
}

.template-requests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.template-requests-table th,
.template-requests-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    text-align: left;
}

.template-requests-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-requests-table tbody tr:hover {
    background: #f8f9fa;
}

.template-requests-table .file-name {
    text-decoration: underline;
    color: #007bff;
    font-weight: 500;
}

.template-requests-table .file-name:hover {
    color: #0056b3;
}

.status-badge.in-progress {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-badge.overdue {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.complete-btn {
    background: #28a745;
    color: white;
}

.complete-btn:hover {
    background: #218838;
    transform: scale(1.1);
}

/* Template Request Statistics */
.template-requests-stats .stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

.template-requests-stats .stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.template-requests-stats .stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #20c997, #198754);
}

.template-requests-stats .stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

@media (max-width: 768px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
    }

    .dashboard-container {
        flex-direction: column !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        margin-left: 0 !important;
        padding: 1rem !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    aside.sidebar {
        display: none !important;
    }
}

    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
    }

    .customer-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .customer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .customer-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .subscriber-table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none !important;
    }

    aside.sidebar {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
