/* ============================================
   PROFESSIONAL ADMIN DASHBOARD STYLES
   Enhanced with Modern Design Patterns
   ============================================ */

/* ============ CUSTOM ICON SYSTEM ============ */
/* Using Unicode symbols instead of Font Awesome */
@font-face {
    font-family: 'CustomIcons';
    src: local('Arial'), local('Segoe UI');
}

.icon::before {
    font-family: 'CustomIcons', 'Arial', sans-serif;
    display: inline-block;
    margin-right: 8px;
}
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* تنسيق الشريط الجانبي */
.sidebar {
    width: 260px; /* عرض ثابت ومناسب للشريط */
    background-color: #2c3e50; /* يمكنك تغيير اللون حسب رغبتك */
    color: #ffffff;
    min-width: 260px;
    transition: all 0.3s ease;
}

/* تنسيق حاوية المحتوى لتأخذ بقية مساحة الشاشة تلقائياً */
.main-content {
    flex-grow: 1;
    background-color: #f8f9fa;
    padding: 25px;
    width: calc(100% - 260px); /* يضمن عدم خروج المحتوى عن الشاشة */
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    border-bottom: 1px solid #34495e;
    transition: background 0.2s;
}

.sidebar ul li a:hover {
    background-color: #34495e;
    color: #fff;
}

@media (max-width: 992px) {
    .admin-wrapper {
        flex-direction: column; /* تحويل التوزيع عمودياً بدلاً من أفقي */
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
    }

    .main-content {
        width: 100%;
        padding: 15px;
    }
}

/* Icon definitions */
.icon-dashboard::before { content: "📊"; }
.icon-products::before { content: "📦"; }
.icon-categories::before { content: "🏷️"; }
.icon-brands::before { content: "🎯"; }
.icon-orders::before { content: "🛒"; }
.icon-customers::before { content: "👥"; }
.icon-suppliers::before { content: "🚚"; }
.icon-purchases::before { content: "📋"; }
.icon-coupons::before { content: "🎟️"; }
.icon-reviews::before { content: "⭐"; }
.icon-settings::before { content: "⚙️"; }
.icon-logout::before { content: "🚪"; }
.icon-add::before { content: "➕"; }
.icon-edit::before { content: "✏️"; }
.icon-delete::before { content: "🗑️"; }
.icon-view::before { content: "👁️"; }
.icon-images::before { content: "🖼️"; }
.icon-variants::before { content: "🔀"; }
.icon-search::before { content: "🔍"; }
.icon-print::before { content: "🖨️"; }
.icon-toggle::before { content: "⚡"; }
.icon-approve::before { content: "✅"; }
.icon-reject::before { content: "❌"; }
.icon-menu::before { content: "☰"; }
.icon-close::before { content: "✕"; }

/* ============ RESET & BASE STYLES ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Segoe UI', 'Helvetica Neue', system-ui, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ LAYOUT STRUCTURE ============ */
/*.admin-wrapper {*/
/*    display: flex;*/
/*    min-height: 100vh;*/
/*    background: #f5f7fa;*/
/*}*/

/* ============ SIDEBAR STYLES ============ */
.admin-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
}

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

.sidebar-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 15px 0;
    flex: 1;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border-right: 3px solid transparent;
    position: relative;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-right-color: #3498db;
    padding-right: 18px;
}

.sidebar-nav li a .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    margin-right: 0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer a {
    color: #e74c3c;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sidebar-footer a:hover {
    color: #c0392b;
    transform: translateX(-3px);
}

/* ============ MAIN CONTENT AREA ============ */
.admin-content {
    flex: 1;
    padding: 30px;
    margin-right: 280px;
    overflow-y: auto;
    background: #f5f7fa;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 700;
    margin: 0;
}

/* ============ DASHBOARD STATS ============ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    border-top: 4px solid #3498db;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card:nth-child(2) {
    border-top-color: #2ecc71;
}

.stat-card:nth-child(2) .stat-value {
    color: #2ecc71;
}

.stat-card:nth-child(3) {
    border-top-color: #f39c12;
}

.stat-card:nth-child(3) .stat-value {
    color: #f39c12;
}

.stat-card:nth-child(4) {
    border-top-color: #e74c3c;
}

.stat-card:nth-child(4) .stat-value {
    color: #e74c3c;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 2.2rem;
    font-weight: 700;
    color: #3498db;
    margin: 0;
    position: relative;
    z-index: 1;
}

.stat-value {
    display: block;
}

/* ============ TABLES ============ */
.data-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.data-table thead {
    background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
}

.data-table th {
    padding: 16px 15px;
    color: white;
    font-weight: 600;
    text-align: right;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 15px;
    border-bottom: 1px solid #ecf0f1;
    text-align: right;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
    box-shadow: inset 0 0 10px rgba(52, 152, 219, 0.05);
}

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

.data-table img {
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.data-table img:hover {
    transform: scale(1.05);
}

/* ============ BADGES ============ */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d5f4e6;
    color: #27ae60;
}

.badge-danger {
    background: #fadbd8;
    color: #e74c3c;
}

.badge-warning {
    background: #fef5e7;
    color: #f39c12;
}

.badge-info {
    background: #d6eaf8;
    color: #3498db;
}

.badge-primary {
    background: #ebdef0;
    color: #8e44ad;
}

.badge-secondary {
    background: #d5dbdb;
    color: #34495e;
}

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary, .btn-sm, .btn-light, .btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #5d6d7b 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.btn-light {
    background: white;
    color: #34495e;
    border: 2px solid #bdc3c7;
}

.btn-light:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.btn-sm {
    background: #ecf0f1;
    color: #2c3e50;
    font-size: 0.75rem;
    padding: 8px 14px;
}

.btn-sm:hover {
    background: #d5dbdb;
    color: #1a252f;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

.btn-icon {
    color: #7f8c8d;
    margin: 0 6px;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #ecf0f1;
}

.btn-icon:hover {
    color: #3498db;
    background: #d6eaf8;
    transform: scale(1.1);
}

.btn-icon.delete-link:hover {
    color: #e74c3c;
    background: #fadbd8;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #f8fbff;
}

.form-control::placeholder {
    color: #95a5a6;
}

select.form-control {
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5f7f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-left: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* ============ ALERTS ============ */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d5f4e6;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.alert-danger {
    background: #fadbd8;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.alert-warning {
    background: #fef5e7;
    color: #f39c12;
    border-left: 4px solid #f39c12;
}

.alert-info {
    background: #d6eaf8;
    color: #3498db;
    border-left: 4px solid #3498db;
}

.alert-close {
    margin-left: auto;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

/* ============ SEARCH & FILTER ============ */
.search-form, .filter-form {
    margin: 20px 0;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-row input, .filter-row select {
    padding: 10px 14px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-row input:focus, .filter-row select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ============ BULK ACTIONS ============ */
.bulk-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

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

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* ============ RESPONSIVE DESIGN ============ */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-content {
        margin-right: 240px;
        padding: 20px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-header {
        width: 100%;
        order: 1;
    }
    
    .sidebar-nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        padding: 10px 0;
        order: 2;
    }
    
    .sidebar-nav li {
        flex: 1 1 calc(50% - 10px);
        min-width: 150px;
    }
    
    .sidebar-nav li a {
        padding: 10px 12px;
        font-size: 0.85rem;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }
    
    .sidebar-nav li a .icon {
        font-size: 1.4rem;
        margin-right: 0;
    }
    
    .sidebar-footer {
        width: 100%;
        order: 3;
        border-top: 2px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        margin-top: 0;
    }
    
    .admin-content {
        margin-right: 0;
        padding: 15px;
        width: 100%;
    }
    
    /*.admin-wrapper {*/
    /*    flex-direction: column;*/
    /*}*/
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-row input, .filter-row select, .filter-row button {
        width: 100%;
        min-width: auto;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th, .data-table td {
        padding: 10px 8px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sidebar-nav li {
        flex: 1 1 calc(33.333% - 10px);
    }
    
    .admin-content {
        padding: 10px;
    }
    
    .page-header {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card p {
        font-size: 1.6rem;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th, .data-table td {
        padding: 8px 5px;
    }
    
    .btn-primary, .btn-secondary, .btn-light, .btn-sm, .btn-danger {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* ============ UTILITY CLASSES ============ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-danger {
    color: #e74c3c;
}

.text-success {
    color: #27ae60;
}

.text-warning {
    color: #f39c12;
}

.text-info {
    color: #3498db;
}

.no-image {
    color: #bdc3c7;
    font-size: 1.2rem;
}

.hidden {
    display: none !important;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-30 {
    margin-bottom: 30px;
}

/* ============ ANIMATIONS ============ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* ============ SCROLLBAR STYLING ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}
