/* ===================================
   Admin Panel CSS - لوحة تحكم الأدمن
   =================================== */

/* تنسيقات عامة */
:root {
    --admin-primary: #0d2a83;
    --admin-success: #1cc88a;
    --admin-info: #36b9cc;
    --admin-warning: #f6c23e;
    --admin-danger: #e74a3b;
    --admin-dark: #2e3338;
    --admin-sidebar: #1a1d20;
    --admin-light: #f8f9fc;
    --admin-border: #e3e6f0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--admin-light);
    color: #333;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary), #224abe);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--admin-primary), #224abe);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.login-body {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control-custom {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(78,115,223,0.1);
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.input-group .form-control-custom {
    padding-left: 45px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    background-color: #2e59d9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78,115,223,0.3);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-forgot a {
    color: var(--admin-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.remember-forgot a:hover {
    text-decoration: underline;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--admin-sidebar);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--admin-primary);
    margin: 0;
}

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

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bbb;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--admin-primary);
}

.sidebar-menu a i {
    margin-left: 15px;
    font-size: 1.2rem;
    width: 25px;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

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

.admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-right: 260px;
    background-color: var(--admin-light);
}

.admin-topbar {
    background-color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-icon {
    position: relative;
    font-size: 1.3rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.topbar-icon:hover {
    color: var(--admin-primary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background-color: var(--admin-danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.admin-content {
    padding: 2rem;
}

/* Dashboard Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-right: 4px solid;
    transition: all 0.3s;
}

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

.stat-card.primary {
    border-color: var(--admin-primary);
}

.stat-card.success {
    border-color: var(--admin-success);
}

.stat-card.warning {
    border-color: var(--admin-warning);
}

.stat-card.danger {
    border-color: var(--admin-danger);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card.primary .stat-card-icon {
    background-color: var(--admin-primary);
}

.stat-card.success .stat-card-icon {
    background-color: var(--admin-success);
}

.stat-card.warning .stat-card-icon {
    background-color: var(--admin-warning);
}

.stat-card.danger .stat-card-icon {
    background-color: var(--admin-danger);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-card-footer {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #888;
}

/* Content Card */
.content-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--admin-border);
}

.content-card-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background-color: var(--admin-light);
}

.admin-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid var(--admin-border);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table tbody tr:hover {
    background-color: var(--admin-light);
}

.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

/* Buttons */
.btn-admin {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-admin-primary:hover {
    background-color: #2e59d9;
}

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

.btn-admin-success:hover {
    background-color: #17a673;
}

.btn-admin-warning {
    background-color: var(--admin-warning);
    color: #333;
}

.btn-admin-warning:hover {
    background-color: #dda20a;
}

.btn-admin-danger {
    background-color: var(--admin-danger);
    color: white;
}

.btn-admin-danger:hover {
    background-color: #c0392b;
}

.btn-admin-sm {
    padding: 5px 15px;
    font-size: 0.85rem;
}

/* Badge */
.badge-admin {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: var(--admin-success);
    color: white;
}

.badge-danger {
    background-color: var(--admin-danger);
    color: white;
}

.badge-warning {
    background-color: var(--admin-warning);
    color: #333;
}

.badge-info {
    background-color: var(--admin-info);
    color: white;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group-admin {
    margin-bottom: 1.5rem;
}

.form-group-admin label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-control-admin {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control-admin:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(78,115,223,0.1);
}

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

.file-upload {
    border: 2px dashed var(--admin-border);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--admin-primary);
    background-color: rgba(78,115,223,0.05);
}

.file-upload i {
    font-size: 3rem;
    color: var(--admin-primary);
    margin-bottom: 1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--admin-border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        margin-right: -260px;
    }
    
    .admin-sidebar.active {
        margin-right: 0;
    }
    
    .admin-main {
        margin-right: 0;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

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

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

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

/* Multiple Image Upload Boxes */
.upload-box {
    border: 2px dashed #d1d3e2;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fc;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.upload-box:hover {
    border-color: #4e73df;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #858796;
    width: 100%;
}

.upload-placeholder i {
    color: #4e73df;
    opacity: 0.6;
}

.upload-placeholder p {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.upload-preview {
    position: relative;
    width: 100%;
    height: 100%;
}

.upload-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    z-index: 10;
}

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

.upload-box .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
}

/* Responsive adjustments for image upload */
@media (max-width: 768px) {
    .upload-box {
        min-height: 150px;
        padding: 15px;
    }
    
    .upload-preview img {
        height: 120px;
    }
    
    .upload-placeholder i {
        font-size: 1.5rem !important;
    }
}

/* Enhanced Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.alert i {
    margin-right: 0.5rem;
}
