:root {
    --primary-color: #5a0f1c; /* Burgundy */
    --secondary-color: #8b1e2d; /* Dark Red */
    --bg-dark: #0f0f0f; /* Very Dark Background */
    --card-bg: #1a1a1a;
    --text-main: #ffffff;
    --accent-color: #c9a96e; /* Soft Gold */
    --glow-shadow: 0 0 15px rgba(90, 15, 28, 0.6);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    padding-bottom: 70px; /* Space for bottom nav on mobile */
}

/* Typography & General */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}
a:hover {
    color: #ffffff;
}
.text-dark {
    color: var(--text-main) !important;
}

/* Header */
.navbar-custom {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(90, 15, 28, 0.3);
    padding: 15px 0;
}
.navbar-brand {
    color: var(--text-main) !important;
    font-weight: 900;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand i {
    color: var(--accent-color);
}
.header-icon {
    color: var(--text-main);
    font-size: 1.5rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.3s ease;
}
.header-icon:hover {
    color: var(--accent-color);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: -320px; /* RTL so right */
    width: 280px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid rgba(90, 15, 28, 0.3);
    z-index: 1050;
    transition: right 0.4s ease;
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    overflow-y: auto;
}
.sidebar.active {
    right: 0;
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 1040;
    display: none;
    backdrop-filter: blur(3px);
}
.sidebar-overlay.active {
    display: block;
}
.sidebar-close {
    color: var(--text-main);
    font-size: 1.5rem;
    background: none;
    border: none;
    align-self: flex-start; /* Because RTL, flex-start is right side */
    margin-bottom: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}
.sidebar-close:hover {
    color: var(--accent-color);
}
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-menu li {
    margin-bottom: 10px;
}
.sidebar-menu a {
    color: var(--text-main);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.sidebar-menu a i {
    font-size: 1.3rem;
}
.sidebar-menu a:hover {
    background: rgba(90, 15, 28, 0.3);
    color: var(--accent-color);
    box-shadow: var(--glow-shadow);
}
.sidebar-menu i {
    color: var(--accent-color);
}

/* Logout button styling */
.sidebar-menu a.text-danger {
    color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.1);
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.sidebar-menu a.text-danger i {
    color: #dc3545 !important;
}

.sidebar-menu a.text-danger:hover {
    background: rgba(220, 53, 69, 0.2);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(90, 15, 28, 0.5);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 15px; /* Extra bottom padding for newer phones */
    z-index: 1030;
}
.bottom-nav-item {
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    text-decoration: none !important;
}
.bottom-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--accent-color);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* Hero Section */
.hero-section {
    background: radial-gradient(circle at top right, rgba(139, 30, 45, 0.15), transparent 60%),
                radial-gradient(circle at bottom left, rgba(90, 15, 28, 0.25), transparent 60%);
    padding: 80px 0;
    text-align: center;
    position: relative;
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(201, 169, 110, 0.2);
}
.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 35px;
    line-height: 1.6;
}
.btn-primary-custom {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--text-main);
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(90, 15, 28, 0.5);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow-shadow);
    color: white;
}
.btn-outline-custom {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid rgba(201, 169, 110, 0.5);
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}
.btn-outline-custom:hover {
    background: rgba(201, 169, 110, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 169, 110, 0.2);
}

/* Category Cards */
.category-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}
.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--glow-shadow);
    border-color: rgba(90, 15, 28, 0.5);
    background: linear-gradient(180deg, var(--card-bg), rgba(90, 15, 28, 0.1));
}
.category-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(201, 169, 110, 0.3);
    transition: transform 0.3s ease;
}
.category-card:hover .category-icon {
    transform: scale(1.1);
}

/* Category Image Styles */
.category-image-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-image-container {
    transform: scale(1.1);
}

.category-card:hover .category-image {
    transform: scale(1.05);
}
.category-title {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

/* Service Cards */
.service-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--glow-shadow);
    border-color: rgba(90, 15, 28, 0.5);
}
.service-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: transform 0.5s ease;
}
.service-card:hover .service-img {
    transform: scale(1.05);
}
.service-body {
    padding: 20px;
    z-index: 2;
    position: relative;
    background: var(--card-bg); /* Prevents image scale from overlapping text */
}
.service-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.25rem;
    text-shadow: 0 0 10px rgba(201, 169, 110, 0.2);
}

/* Stats */
.stats-section {
    background: var(--card-bg);
    padding: 50px 0;
    border-top: 1px solid rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.stat-item {
    text-align: center;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(201, 169, 110, 0.3);
    margin-bottom: 5px;
}
.stat-label {
    color: rgba(255,255,255,0.6);
    font-weight: 600;
}

/* Footer Section */
.footer {
    background: var(--card-bg);
    border-top: 1px solid rgba(90,15,28,0.2);
    padding: 60px 0 20px;
}
.footer-brand {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 900;
    display: inline-block;
}
.footer-brand i {
    color: var(--accent-color);
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 30px;
}
.search-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-radius: 30px;
    padding: 14px 20px 14px 50px; /* RTL: left icon padding */
    width: 100%;
    transition: all 0.3s ease;
}
html[dir="rtl"] .search-input {
    padding: 14px 45px 14px 20px; /* right icon padding */
}
.search-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(201, 169, 110, 0.2);
    outline: none;
}
.search-input::placeholder {
    color: rgba(255,255,255,0.4);
}
.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0; /* Ensures element is hidden before animation */
}

/* Utils */
.text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Fixes */
.badge {
    border-radius: 8px;
    padding: 0.4em 0.6em;
    font-weight: 600;
}
.bg-warning {
    background-color: var(--accent-color) !important;
    color: var(--bg-dark) !important;
}
hr {
    border-color: rgba(255,255,255,0.1) !important;
}
