/* Subscription Services Page Styles - Updated to match image */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Arial', sans-serif;
    background-color: #f8f9fa;
    direction: rtl;
    font-size: 14px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Top Header */
.top-header {
    background-color: #ffffff;
    padding: 15px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 3px solid #f8f9fa;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
}

.user-role {
    font-size: 13px;
    color: #718096;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.search-bar input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-bar i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.header-icons {
    display: flex;
    gap: 15px;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s;
}

.header-icon:hover {
    background-color: #edf2f7;
    color: #2d3748;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-left: 1px solid #e9ecef;
    padding: 20px 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.sidebar-menu li a i {
    margin-left: 15px;
    font-size: 18px;
    width: 20px;
}

.sidebar-menu li.active a {
    background-color: #f7fafc;
    color: #667eea;
    border-right-color: #667eea;
}

.sidebar-menu li:hover a {
    background-color: #f7fafc;
    color: #2d3748;
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    padding: 30px;
    background-color: #ffffff;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 15px;
    color: #718096;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.action-btn i {
    font-size: 16px;
}

/* Table Container */
.table-container {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

/* Table Styling */
.subscription-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.subscription-table th {
    background-color: #f8f9fa;
    padding: 18px 20px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.subscription-table td {
    padding: 18px 20px;
    text-align: center;
    border-bottom: 1px solid #f1f3f4;
    color: #2d3748;
    vertical-align: middle;
}

.subscription-table tbody tr {
    transition: background-color 0.2s;
}

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

.subscription-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-unpaid {
    background-color: #f8d7da;
    color: #721c24;
}

/* Checkbox Styling */
.checkbox-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.checkbox-container input {
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    right: 0;
    height: 18px;
    width: 18px;
    background-color: #ffffff;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #667eea;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    right: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background-color: #ffffff;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn i {
    font-size: 14px;
}

.results-per-page {
    margin-right: 20px;
}

.results-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #ffffff;
    color: #495057;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Header Logo - Only for mobile */
    .top-header::before {
        content: "محامو المملكة";
        display: block;
        text-align: center;
        margin-bottom: 5px;
        font-size: 16px;
        color: #2d3748;
        font-weight: 700;
    }
    
    .top-header::after {
        content: "MOHAMEDON KSA\A المملكة العربية السعودية";
        white-space: pre-line;
        display: block;
        text-align: center;
        margin-bottom: 15px;
        line-height: 1.3;
        font-size: 12px;
        color: #c49b61;
        font-weight: 500;
    }
    
    .top-header {
        flex-direction: column;
        padding: 20px 15px;
        gap: 15px;
    }
    
    .header-controls {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .user-profile {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }
    
    /* Mobile Search Bar */
    .header-controls .search-bar {
        width: 100%;
        max-width: 350px;
    }
    
    .header-controls .search-bar input {
        width: 100%;
        padding: 12px 40px 12px 15px;
        font-size: 15px;
        background-color: #f8f9fa;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
    
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
        display: none; /* Hide sidebar on mobile */
    }
    
    .main-content-area {
        order: 1;
        padding: 20px 15px;
        background-color: #f8f9fa;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        margin-bottom: 20px;
    }
    
    .page-title {
        font-size: 20px;
        text-align: center;
        width: 100%;
    }
    
    .page-subtitle {
        text-align: center;
        width: 100%;
        font-size: 14px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Mobile Table */
    .table-container {
        overflow-x: auto;
        background-color: #ffffff;
        border-radius: 8px;
        margin-top: 15px;
    }
    
    .subscription-table {
        display: block;
        width: 100%;
    }
    
    .subscription-table thead {
        display: none;
    }
    
    .subscription-table tbody {
        display: block;
    }
    
    .subscription-table tr {
        display: block;
        background-color: #ffffff;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #e9ecef;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .subscription-table td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border: none;
        position: relative;
        padding-right: 140px;
    }
    
    .subscription-table td:before {
        content: attr(data-label);
        position: absolute;
        right: 0;
        width: 130px;
        font-weight: 600;
        color: #495057;
        font-size: 13px;
    }
    
    /* Status badges styling for mobile */
    .subscription-table td:nth-child(2)::before { content: "كود المستخدم:"; }
    .subscription-table td:nth-child(3)::before { content: "اسم المستخدم:"; }
    .subscription-table td:nth-child(4)::before { content: "حالة السداد:"; }
    .subscription-table td:nth-child(5)::before { content: "الخدمة المطلوبة:"; }
    .subscription-table td:nth-child(6)::before { content: "الخدمة:"; }
    .subscription-table td:nth-child(7)::before { content: "المبلغ:"; }
    .subscription-table td:nth-child(8)::before { content: "العدد:"; }
    .subscription-table td:nth-child(9)::before { content: "تاريخ الطلب:"; }
    
    .subscription-table td:first-child {
        padding-right: 0;
        text-align: center;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #dee2e6;
    }
    
    .subscription-table td:first-child:before {
        display: none;
    }
    
    .subscription-table td:last-child {
        padding-right: 0;
        text-align: center;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #dee2e6;
    }
    
    .subscription-table td:last-child:before {
        display: none;
    }
    
    .action-btn-sm {
        min-width: 44px;
        min-height: 44px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Action buttons in table */
.action-btn-sm {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #ffffff;
    color: #4a5568;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn-sm:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    color: #667eea;
}

.action-btn-sm i {
    font-size: 14px;
}

/* Small Mobile - Only for mobile */
@media (max-width: 576px) {
    .top-header::before {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .top-header::after {
        font-size: 11px;
        margin-bottom: 12px;
        line-height: 1.2;
    }
    
    .top-header {
        padding: 15px 10px;
    }
    
    .main-content-area {
        padding: 15px 10px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .page-subtitle {
        font-size: 13px;
    }
    
    .action-btn {
        min-width: 80px;
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
    }
    
    .subscription-table tr {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .subscription-table td {
        padding-right: 120px;
        font-size: 13px;
    }
    
    .subscription-table td:before {
        width: 110px;
        font-size: 12px;
    }
}

/* Extra Small Mobile - Only for mobile */
@media (max-width: 400px) {
    .top-header::before {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .top-header::after {
        font-size: 10px;
        margin-bottom: 10px;
    }
    
    .top-header {
        padding: 12px 8px;
    }
    
    .main-content-area {
        padding: 12px 8px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .page-subtitle {
        font-size: 12px;
    }
    
    .action-btn {
        min-width: 70px;
        font-size: 11px;
        min-height: 38px;
    }
    
    .subscription-table tr {
        padding: 10px;
    }
    
    .subscription-table td {
        padding-right: 100px;
        font-size: 12px;
    }
    
    .subscription-table td:before {
        width: 90px;
        font-size: 11px;
    }
}
