/* Admin Panel Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #f5f5f5;
    direction: rtl;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #1A2B3C;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #2C3E50;
    text-align: center;
}

.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #C8A25C;
    margin-bottom: 0.5rem;
}

.sidebar-header .subtitle {
    font-size: 0.9rem;
    color: #B0BEC5;
}

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

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #B0BEC5;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(200, 162, 92, 0.1);
    color: #C8A25C;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #C8A25C;
}

.sidebar-nav i {
    margin-left: 1rem;
    width: 20px;
    text-align: center;
}

.badge {
    background: #e74c3c;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-right: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    padding: 2rem;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 2rem;
    color: #1A2B3C;
    margin-bottom: 0.5rem;
}

.content-header p {
    color: #666;
    font-size: 1.1rem;
}

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

.stat-card {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-icon.services {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.stat-icon.projects {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.stat-icon.gallery {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.stat-icon.messages {
    background: linear-gradient(45deg, #27ae60, #229954);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1A2B3C;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #666;
    font-size: 1rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h2 {
    font-size: 1.5rem;
    color: #1A2B3C;
    margin-bottom: 1.5rem;
}

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

.action-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: #C8A25C;
    color: #C8A25C;
}

.action-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #C8A25C;
}

.action-card span {
    display: block;
    font-weight: 600;
}

/* Recent Messages */
.recent-messages {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recent-messages h2 {
    font-size: 1.5rem;
    color: #1A2B3C;
    margin-bottom: 1.5rem;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message-item {
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.message-item.unread {
    border-color: #C8A25C;
    background: rgba(200, 162, 92, 0.05);
}

.message-item:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-header h4 {
    color: #1A2B3C;
    font-weight: 600;
}

.message-date {
    color: #666;
    font-size: 0.9rem;
}

.message-preview {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-type {
    background: #f0f0f0;
    color: #666;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

.view-message {
    color: #C8A25C;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.view-message:hover {
    color: #D4B570;
}

.view-all-messages {
    display: inline-block;
    background: linear-gradient(45deg, #C8A25C, #D4B570);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-all-messages:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(200, 162, 92, 0.3);
}

/* Forms */
.form-container {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #C8A25C;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
}

.btn-primary {
    background: linear-gradient(45deg, #C8A25C, #D4B570);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(200, 162, 92, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1A2B3C;
}

.table tr:hover {
    background: #f8f9fa;
}

.table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        right: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        background: #1A2B3C;
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    .sidebar.active {
        right: 0;
    }
    .main-content {
        margin-right: 0 !important;
        padding: 1rem;
        width: 100%;
    }
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1100;
        background: #C8A25C;
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 900;
    }
    .sidebar.active ~ .sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
    }
    .sidebar-header {
        padding: 1.5rem 1rem;
    }
    .sidebar-header .logo {
        font-size: 1.3rem;
    }
    .sidebar-header .subtitle {
        font-size: 0.8rem;
    }
    .sidebar-nav a {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    .sidebar-nav i {
        margin-left: 0.8rem;
        width: 18px;
        font-size: 0.9rem;
    }
    .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr {
        display: block;
        width: 100%;
    }
    .admin-table th, .admin-table td {
        text-align: right;
        padding: 10px;
    }
    .form-container, .form-group, .form-row {
        width: 100% !important;
        display: block !important;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .content-header h1 {
        font-size: 1.5rem;
    }
    .content-header p {
        font-size: 1rem;
    }
}

/* زر القائمة الجانبية مخفي افتراضياً على الشاشات الكبيرة */
.mobile-menu-toggle {
    display: none;
}

/* طبقة التعتيم مخفية افتراضياً */
.sidebar-overlay {
    display: none;
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        right: -100%;
    }
    .sidebar.active {
        right: 0;
    }
    .mobile-menu-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    .sidebar-header {
        padding: 1rem 0.8rem;
    }
    .sidebar-header .logo {
        font-size: 1.2rem;
    }
    .sidebar-nav a {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    .sidebar-nav i {
        margin-left: 0.6rem;
        width: 16px;
        font-size: 0.8rem;
    }
    .main-content {
        padding: 0.8rem;
    }
    .content-header h1 {
        font-size: 1.3rem;
    }
    .stat-card {
        padding: 1rem;
    }
    .stat-info h3 {
        font-size: 1.5rem;
    }
    .form-container {
        padding: 1rem;
    }
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.8rem;
        font-size: 16px; /* منع التكبير التلقائي على iOS */
    }
    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* تحسينات للتابلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    .main-content {
        margin-right: 250px;
        padding: 1.5rem;
    }
    .sidebar-nav a {
        padding: 0.9rem 1.2rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* File Upload */
.file-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 2rem;
    border: 2px dashed #C8A25C;
    border-radius: 8px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.file-upload:hover .file-upload-label {
    background: #f0f0f0;
    border-color: #D4B570;
}

.file-upload-icon {
    font-size: 2rem;
    color: #C8A25C;
    margin-bottom: 1rem;
}

.file-upload-text {
    color: #666;
    font-weight: 500;
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

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

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

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        transform: none;
    }
    
    .sidebar.active {
        transform: none;
    }
    
    .main-content {
        margin-right: 0;
        padding: 15px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .admin-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .admin-table {
        min-width: 600px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .message-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .message-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sidebar-header h2 {
        font-size: 1.2rem;
    }
    
    .sidebar-nav a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .admin-form {
        padding: 15px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 14px;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Improved form styling for mobile */
.form-container {
    max-width: 100%;
    overflow-x: hidden;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Table responsive improvements */
.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.admin-table {
    min-width: 600px;
}

/* Better button spacing on mobile */
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions .btn {
    flex: 1;
    min-width: auto;
}

/* زر إخفاء/إظهار الشريط الجانبي */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 300px;
    z-index: 1200;
    background: #C8A25C;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #D4B570;
    transform: scale(1.1);
}

/* حالة الشريط الجانبي المخفي */
.sidebar.collapsed {
    right: -280px;
}

/* تعديل المحتوى الرئيسي عند إخفاء الشريط */
.main-content.expanded {
    margin-right: 0 !important;
    width: 100%;
}

/* تعديل موقع زر الإخفاء عند إخفاء الشريط */
.sidebar-toggle.collapsed {
    right: 20px;
}

/* إخفاء زر الإخفاء على الشاشات الصغيرة */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: none;
    }
}

