/* ============================================
   ADMIN PANEL STYLES - Dahab Real Estate
   ============================================ */

:root {
    --primary-gold: #C6A256;
    --primary-dark: #2C2C2C;
    --primary-white: #FFFFFF;
    --secondary-gray: #F5F5F5;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --success: #25D366;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --transition: all 0.3s ease;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--secondary-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1a1a1a 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-box {
    background: var(--primary-white);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group label i {
    color: var(--primary-gold);
    margin-right: 5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary-gold);
    color: var(--primary-white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #b8944a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--secondary-gray);
    color: var(--text-dark);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.login-footer .warning {
    color: var(--warning);
    margin-top: 0.5rem;
    font-weight: 600;
}

/* ============================================
   ADMIN DASHBOARD LAYOUT
   ============================================ */

.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: var(--primary-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.3rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-white);
}

.nav-link.active {
    background: rgba(198, 162, 86, 0.2);
    color: var(--primary-gold);
    border-left: 4px solid var(--primary-gold);
}

.nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.user-info i {
    font-size: 2.5rem;
    color: var(--primary-gold);
}

.user-info strong {
    display: block;
    font-size: 0.95rem;
}

.user-info small {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: var(--primary-white);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: var(--danger);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    background: var(--primary-white);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.topbar h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.topbar-actions {
    display: flex;
    gap: 1rem;
}

.btn-view-site {
    padding: 10px 20px;
    background: var(--primary-gold);
    color: var(--primary-white);
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-view-site:hover {
    background: #b8944a;
}

.content-area {
    padding: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.8rem;
    color: var(--primary-dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--primary-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.widget {
    background: var(--primary-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.widget h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget h3 i {
    color: var(--primary-gold);
}

/* Table */
.table-container {
    background: var(--primary-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--secondary-gray);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--secondary-gray);
}

.data-table td.loading {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.data-table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.finishing { background: #dbeafe; color: #1e40af; }
.badge.marketing { background: #fef3c7; color: #92400e; }
.badge.development { background: #e0e7ff; color: #3730a3; }
.badge.completed { background: #d1fae5; color: #065f46; }
.badge.ongoing { background: #fed7aa; color: #9a3412; }
.badge.upcoming { background: #e0e7ff; color: #3730a3; }
.badge.new { background: #fecaca; color: #991b1b; }
.badge.contacted { background: #fed7aa; color: #9a3412; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
    color: var(--text-light);
}

.btn-icon:hover {
    background: var(--secondary-gray);
}

.btn-icon.edit:hover { color: var(--info); }
.btn-icon.delete:hover { color: var(--danger); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--primary-white);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-content form {
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-filter {
    padding: 8px 16px;
    background: var(--secondary-gray);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.btn-filter.active {
    background: var(--primary-gold);
    color: var(--primary-white);
}

.btn-filter:hover {
    border-color: var(--primary-gold);
}

/* Testimonials Grid */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.testimonial-card {
    background: var(--primary-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

.testimonial-card .stars {
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.testimonial-card p {
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.testimonial-card .client-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.testimonial-card .delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Stats Form */
.stats-form {
    display: grid;
    gap: 1.5rem;
}

.stat-input-group {
    background: var(--primary-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 1rem;
}

.stat-input-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.stat-input-group input {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

/* Settings Form */
.settings-form {
    display: grid;
    gap: 2rem;
}

.settings-section {
    background: var(--primary-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-gold);
}

/* Loading */
.loading {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
