/* Custom Styles for Malaeb Oman */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #0D9488;
    --primary-dark: #0F766E;
    --primary-light: #14B8A6;
    --secondary: #64748B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1E293B;
    --light: #F8FAFC;
    --gray: #94A3B8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .ps-3 {
    padding-right: 1rem !important;
    padding-left: 0 !important;
}

[dir="rtl"] .pe-3 {
    padding-left: 1rem !important;
    padding-right: 0 !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Custom Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-danger {
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-success {
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
}

/* Cards */
.card {
    border-radius: 1.25rem;
    transition: all 0.3s ease;
    overflow: hidden;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    background-color: transparent;
    border-bottom: 2px solid rgba(13, 148, 136, 0.1);
    font-weight: 700;
}

/* Venue Card */
.venue-card {
    overflow: hidden;
    border-radius: 1.25rem;
}

.venue-card .card-img-top {
    transition: transform 0.5s ease;
    height: 220px;
    object-fit: cover;
}

.venue-card:hover .card-img-top {
    transform: scale(1.05);
}

.venue-card .card-body {
    padding: 1.25rem;
}

.venue-card .card-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Rating Stars */
.rating {
    display: inline-flex;
    direction: ltr;
    gap: 0.25rem;
}

.rating input {
    display: none;
}

.rating label {
    color: #CBD5E1;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rating label:hover,
.rating label:hover ~ label,
.rating input:checked ~ label {
    color: var(--warning);
}

.stars {
    color: #CBD5E1;
    font-size: 0.875rem;
}

.stars .filled {
    color: var(--warning);
}

/* Time Slots */
.time-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.time-slot {
    padding: 0.75rem 1.25rem;
    border: 2px solid #E2E8F0;
    border-radius: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    min-width: 80px;
}

.time-slot:hover {
    border-color: var(--primary);
    background-color: rgba(13, 148, 136, 0.05);
    transform: translateY(-2px);
}

.time-slot.selected {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.time-slot.disabled {
    background-color: #F1F5F9;
    color: var(--gray);
    cursor: not-allowed;
    text-decoration: line-through;
    border-color: #E2E8F0;
}

.time-slot.disabled:hover {
    transform: none;
    background-color: #F1F5F9;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 0 0 3rem 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='rgba(255,255,255,0.1)' fill-opacity='1' d='M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

/* Search Form */
.search-form {
    background: white;
    border-radius: 1.5rem;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-form .form-control,
.search-form .input-group-text {
    border: none;
    background: transparent;
}

.search-form .form-control:focus {
    box-shadow: none;
}

/* Modal */
.modal-content {
    border-radius: 1.25rem;
    border: none;
}

.modal-header {
    border-bottom: 2px solid rgba(13, 148, 136, 0.1);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 2px solid rgba(13, 148, 136, 0.1);
    padding: 1.25rem 1.5rem;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 0.75rem;
    border: 2px solid #E2E8F0;
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Alert */
.alert {
    border-radius: 1rem;
    border: none;
    padding: 1rem 1.25rem;
}

/* Badge */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* Table */
.table {
    border-radius: 1rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 0.5rem;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0;
    color: var(--primary);
    font-weight: 600;
}

.page-link:hover {
    background-color: var(--primary);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary);
    color: white;
}

/* Map Container */
#map {
    height: 400px;
    width: 100%;
    border-radius: 1rem;
    z-index: 1;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
}

/* Notifications Dropdown */
.notifications-dropdown {
    max-height: 450px;
    overflow-y: auto;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.notification-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #E2E8F0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--light);
}

.notification-item.unread {
    background-color: rgba(13, 148, 136, 0.05);
    border-right: 3px solid var(--primary);
}

.notification-item.unread[dir="rtl"] {
    border-right: none;
    border-left: 3px solid var(--primary);
}

/* Image Gallery */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-image {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.gallery-image:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Stats Card */
.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .icon {
    width: 60px;
    height: 60px;
    background: rgba(13, 148, 136, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.stat-card .icon i {
    font-size: 2rem;
    color: var(--primary);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-card .label {
    color: var(--gray);
    font-weight: 500;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark) 0%, #0F172A 100%);
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--primary) !important;
    transform: translateX(5px);
}

[dir="rtl"] footer a:hover {
    transform: translateX(-5px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        border-radius: 0 0 1.5rem 1.5rem;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .stat-card .number {
        font-size: 1.5rem;
    }
    
    .time-slots-container {
        gap: 0.5rem;
    }
    
    .time-slot {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 65px;
    }
    
    .table-responsive-card {
        display: block;
    }
    
    .table-responsive-card thead {
        display: none;
    }
    
    .table-responsive-card tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #E2E8F0;
        border-radius: 0.75rem;
        padding: 1rem;
    }
    
    .table-responsive-card tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
    }
    
    .table-responsive-card tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
    }
    
    [dir="rtl"] .table-responsive-card tbody td:before {
        margin-left: 1rem;
        margin-right: 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.dashboard-card .card-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--dark) 0%, #0F172A 100%);
    min-height: 100vh;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-link.active {
    background-color: var(--primary);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 1.25rem;
}

[dir="rtl"] .sidebar .nav-link i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Responsive Utilities */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .display-3 {
        font-size: 2.5rem;
    }
    .display-4 {
        font-size: 2rem;
    }
    .display-5 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .display-3 {
        font-size: 2rem;
    }
    .display-4 {
        font-size: 1.75rem;
    }
    .display-5 {
        font-size: 1.5rem;
    }
    .lead {
        font-size: 1rem;
    }
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    .rounded-4 {
        border-radius: 1rem !important;
    }
}

@media (max-width: 576px) {
    .display-3 {
        font-size: 1.75rem;
    }
    .display-4 {
        font-size: 1.5rem;
    }
    .display-5 {
        font-size: 1.25rem;
    }
    .fs-1 {
        font-size: 1.25rem !important;
    }
    .fs-2 {
        font-size: 1.125rem !important;
    }
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    .g-4 {
        gap: 1rem !important;
    }
}

/* Grid improvements */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Touch friendly buttons */
@media (max-width: 768px) {
    button, 
    .btn,
    a.nav-link,
    .card a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}