/* Gift Cards & Facebook Balance Management System - RTL Arabic Styles */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-hover: #34495e;
    --sidebar-active: #1abc9c;
    --primary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    right: 0;
    top: 0;
    z-index: 999;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    margin-right: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-header i {
    margin-left: 8px;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-item.active > .nav-link {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav .nav-link i {
    margin-left: 10px;
    font-size: 1.1rem;
    width: 25px;
    text-align: center;
}

.sidebar-nav .nav-link span {
    flex: 1;
}

.sidebar-nav .nav-link .badge {
    font-size: 0.7rem;
}

/* Submenu */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-nav ul .nav-link {
    padding-right: 50px;
    font-size: 0.9rem;
}

.sidebar-nav ul .nav-link.active {
    background: var(--sidebar-active);
}

/* Dropdown Toggle */
.dropdown-toggle::after {
    margin-right: auto;
    margin-left: 0;
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

/* User Info */
.user-info .nav-link {
    background: rgba(0, 0, 0, 0.1);
    cursor: default;
}

.user-info .nav-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Main Content */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-right: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
}

#content.expanded {
    width: 100%;
    margin-right: 0;
}

/* Top Navbar */
#content .navbar {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-card {
    text-align: center;
    padding: 25px;
    border-radius: 10px;
    color: #fff;
    margin-bottom: 20px;
}

.stats-card.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.stats-card.success {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.stats-card.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.stats-card.info {
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

.stats-card .stats-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Summary Table */
.summary-table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.summary-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.summary-table .total-row {
    background: #e8f4f8;
    font-weight: 700;
}

/* Forms */
.form-label {
    font-weight: 600;
    margin-bottom: 8px;
}

.form-control, .form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #ddd;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
}

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

.btn-success:hover {
    background: #229954;
    border-color: #229954;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Filter Card */
.filter-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.filter-card .row {
    align-items: flex-end;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.page-link {
    border-radius: 8px !important;
    margin: 0 3px;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-card .form-control {
    margin-bottom: 20px;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h4 {
    margin-bottom: 10px;
}

/* Action Buttons */
.action-btns .btn {
    padding: 5px 10px;
    margin: 0 2px;
}

/* Period Stats */
.period-stats {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.period-stats h5 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item .label {
    color: #666;
}

.stat-item .value {
    font-weight: 600;
    color: #333;
}

.stat-item .value.positive {
    color: var(--success-color);
}

.stat-item .value.negative {
    color: var(--danger-color);
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .no-print, .btn, .filter-card {
        display: none !important;
    }
    
    #content {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        background: #fff !important;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        margin-right: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.show {
        margin-right: 0;
    }
    
    #content {
        width: 100%;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .stats-card {
        margin-bottom: 15px;
    }
    
    .filter-card .col-md-2,
    .filter-card .col-md-3 {
        margin-bottom: 10px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}
