/* ============================================
   ABC Luxury - Main Stylesheet
   Version: 1.0.0
   ============================================ */

:root {
    --primary-bg: #0f172a;
    --sidebar-color: #1e293b;
    --accent-color: #d4af37;
    --sidebar-width: 260px;
    --sidebar-mini-width: 85px;
    --transition-speed: 0.3s;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --navbar-bg: #ffffff;
}

[data-theme="dark"] {
    --body-bg: #020617;
    --card-bg: #0f172a;
    --text-main: #f8fafc;
    --sidebar-color: #020617;
    --navbar-bg: #0f172a;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    transition: background-color var(--transition-speed);
    margin: 0;
}

/* ---- Sidebar ---- */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-bg);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    top: 0;
    transition: all var(--transition-speed);
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

[dir="rtl"] #sidebar { right: 0; }
[dir="ltr"] #sidebar { left: 0; }
#sidebar.mini { width: var(--sidebar-mini-width); }

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(255,255,255,0.05);
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
}

.company-logo {
    max-width: 150px;
    height: auto;
    transition: var(--transition-speed);
    filter: brightness(0) invert(1);
}

#sidebar.mini .company-logo { max-width: 50px; }
#sidebar.mini #sidebarCompanyName { display: none !important; }

#sidebar .nav-link {
    padding: 15px 25px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: 0.2s;
    white-space: nowrap;
}

#sidebar.mini .nav-link span { display: none; }

#sidebar .nav-link i {
    font-size: 1.2rem;
    min-width: 35px;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    background: var(--sidebar-color);
    color: var(--accent-color);
    border-right: 4px solid var(--accent-color);
}

[dir="ltr"] #sidebar .nav-link:hover, [dir="ltr"] #sidebar .nav-link.active {
    border-right: none;
    border-left: 4px solid var(--accent-color);
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 15px;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-link {
    color: var(--accent-color) !important;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    display: block;
    margin-bottom: 5px;
}

.footer-link:hover {
    filter: brightness(1.2);
    text-decoration: underline;
}

/* ---- Content Area ---- */
#content {
    padding-right: var(--sidebar-width);
    transition: all var(--transition-speed);
    min-height: 100vh;
}

[dir="ltr"] #content { padding-right: 0; padding-left: var(--sidebar-width); }
#sidebar.mini ~ #content { padding-right: var(--sidebar-mini-width); }
[dir="ltr"] #sidebar.mini ~ #content { padding-left: var(--sidebar-mini-width); padding-right: 0; }

/* ---- Navbar ---- */
.navbar {
    background: var(--navbar-bg) !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0 20px;
    height: 70px;
    color: var(--text-main);
}

.nav-tool-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.05);
    background: rgba(0,0,0,0.02);
    position: relative;
}

.nav-tool-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.badge-notify {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.65rem;
    padding: 2px 5px;
    transform: translate(25%, -25%);
    border: 2px solid var(--navbar-bg);
    line-height: 1;
}

/* ---- Cards ---- */
.card {
    background-color: var(--card-bg);
    border: none;
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-radius: 15px;
    overflow: hidden;
}

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

/* ---- Progress ---- */
.progress { height: 8px; border-radius: 10px; background-color: rgba(0,0,0,0.05); }
.progress-bar { background-color: var(--accent-color); }

/* ---- Status Pills ---- */
.status-pill { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-paid { background: rgba(25, 135, 84, 0.1); color: #198754; }
.status-pending { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.status-overdue { background: rgba(220, 53, 69, 0.1); color: #dc3545; }

/* ---- Forms ---- */
.form-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.form-control, .form-select {
    border-radius: 10px;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: rgba(0,0,0,0.01);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.1);
}

/* ---- Custom Alert ---- */
#customAlert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: none;
    min-width: 300px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    border-radius: 12px;
}

/* ---- Project Image ---- */
.project-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ---- Spacing ---- */
.fw-bold i, h4 i, h6 i { margin-inline-end: 12px; }

/* ---- Animations ---- */
.content-section { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #sidebar { width: var(--sidebar-mini-width); }
    #sidebar .nav-link span { display: none; }
    #sidebar #sidebarCompanyName { display: none !important; }
    #content { padding-right: var(--sidebar-mini-width) !important; }
    [dir="ltr"] #content { padding-left: var(--sidebar-mini-width) !important; padding-right: 0 !important; }
}

/* Client Card Colors */
.client-card-villa {
    border-top: 4px solid #8b5cf6;
    background: linear-gradient(135deg, rgba(139,92,246,0.05) 0%, transparent 100%);
}

.client-card-palace {
    border-top: 4px solid #ec4899;
    background: linear-gradient(135deg, rgba(236,72,153,0.05) 0%, transparent 100%);
}

.client-card-commercial {
    border-top: 4px solid #06b6d4;
    background: linear-gradient(135deg, rgba(6,182,212,0.05) 0%, transparent 100%);
}

.client-card-interior {
    border-top: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, transparent 100%);
}

.client-card-other {
    border-top: 4px solid #64748b;
    background: linear-gradient(135deg, rgba(100,116,139,0.05) 0%, transparent 100%);
}


/* ============================================
   CRM Module Styles
   ============================================ */

/* Analytics Mini Cards */
.analytic-mini {
    border-right: 3px solid var(--accent-color);
    background: rgba(212, 175, 55, 0.05);
    padding: 12px 15px;
    border-radius: 8px;
}

[dir="ltr"] .analytic-mini {
    border-right: none;
    border-left: 3px solid var(--accent-color);
}

/* Star Rating */
.star-rating { color: #fbbf24; font-size: 0.7rem; }

/* Health Bar */
.health-bar {
    height: 6px;
    border-radius: 10px;
    background: #e2e8f0;
    overflow: hidden;
    width: 80px;
    display: inline-block;
    margin-inline-end: 8px;
}

[data-theme="dark"] .health-bar { background: #334155; }

.health-bar-inner {
    height: 100%;
    background: var(--accent-color);
    border-radius: 10px;
}

/* Status Badges */
.status-badge { padding: 4px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.status-active { background: #dcfce7; color: #166534; }
.status-lead { background: #dbeafe; color: #1e40af; }
.status-sampling { background: #fef9c3; color: #854d0e; }
.status-completed { background: #f0fdf4; color: #15803d; }

[data-theme="dark"] .status-active { background: rgba(22,101,52,0.2); }
[data-theme="dark"] .status-lead { background: rgba(30,64,175,0.2); }
[data-theme="dark"] .status-sampling { background: rgba(133,77,14,0.2); }

/* Task Cards */
.task-card {
    border-right: 4px solid #64748b;
    background: rgba(0,0,0,0.02);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: 0.2s;
}

[dir="ltr"] .task-card { border-right: none; border-left: 4px solid #64748b; }

.task-card.urgent { border-color: #ef4444; background: rgba(239,68,68,0.05); }
.task-card.high { border-color: #f59e0b; background: rgba(245,158,11,0.05); }
.task-card:hover { transform: translateX(-3px); }
[dir="ltr"] .task-card:hover { transform: translateX(3px); }

/* Task Cards Large (Modal) */
.task-card-large {
    border-right: 4px solid #64748b;
    background: rgba(0,0,0,0.02);
    padding: 16px 18px;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: 0.2s;
}

[dir="ltr"] .task-card-large { border-right: none; border-left: 4px solid #64748b; }

.task-card-large.urgent { border-color: #ef4444; background: rgba(239,68,68,0.08); }
.task-card-large.high { border-color: #f59e0b; background: rgba(245,158,11,0.08); }
.task-card-large:hover { transform: translateX(-4px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
[dir="ltr"] .task-card-large:hover { transform: translateX(4px); }

.tasks-list-large {
    max-height: 500px;
    overflow-y: auto;
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.05) 100%);
    border-radius: 15px 15px 0 0;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    background: rgba(0,0,0,0.02);
    border-radius: 0 0 15px 15px;
}

/* Timeline */
.timeline-item {
    border-right: 2px solid #e2e8f0;
    padding-right: 20px;
    padding-bottom: 20px;
    position: relative;
}

[dir="ltr"] .timeline-item {
    border-right: none;
    border-left: 2px solid #e2e8f0;
    padding-right: 0;
    padding-left: 20px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    right: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
}

[dir="ltr"] .timeline-item::before { right: auto; left: -7px; }
[data-theme="dark"] .timeline-item { border-color: #334155; }

/* Action Circle Buttons */
.btn-action-circle {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: 0.2s; border: none; color: white;
}

/* Pulse Animation */
.pulse { animation: shadow-pulse 2s infinite; }
@keyframes shadow-pulse {
    0% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.4); }
    100% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

/* Search Box */
.search-box { position: relative; }
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
[dir="rtl"] .search-box i { left: auto; right: 12px; }
.search-box input {
    padding-left: 35px;
    border-radius: 50px;
    font-size: 0.9rem;
}
[dir="rtl"] .search-box input { padding-left: 1rem; padding-right: 35px; }

/* Toast Notifications */
#notification-container {
    position: fixed; top: 20px; left: 20px; z-index: 9999;
}
[dir="rtl"] #notification-container { left: auto; right: 20px; }

.custom-toast {
    background: var(--primary-bg); color: white; padding: 12px 20px;
    border-radius: 8px; margin-bottom: 10px;
    border-right: 4px solid var(--accent-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}
