/* Import Tajawal Font */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

body,
html {
    direction: rtl;
    text-align: right;
}

/* Base Font Family */
body,
html,
.navbar,
.navbar-brand,
.navbar-nav .nav-link,
.search-container,
.locations-container,
.footer {
    font-family: 'Tajawal', Arial, sans-serif;
}

/* Navigation Font Styling */
.navbar-brand {
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
}

/* Header/Navigation Styling with Transparent Background */
.navbar {
    background-color: rgba(65, 36, 20, 0.9) !important;
    /* #412414 with transparency */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand,
.navbar-nav .nav-link {
    color: white !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-item.active .nav-link {
    color: #f0f0f0 !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 4rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="20" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.page-header h1 {
    font-family: 'Tajawal', Arial, sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.page-header p {
    font-family: 'Tajawal', Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Search Section */
.search-container {
    padding-top: 3rem;
    background: #f8f9fa;
}

.search-box {
    font-family: 'Tajawal', Arial, sans-serif;
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    background: #f8f9fa;
    margin: 0 auto;
    display: block;
}

.search-box:focus {
    outline: none;
    border-color: #191919;
    background: white;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.search-box::placeholder {
    color: #a0aec0;
}

/* Locations Grid - Single Card Layout */
.locations-container {
    background: #f8f9fa;
    min-height: 60vh;
    padding: 3rem 0;
}

.locations-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
}

/* Modern Location Cards - Side Image Layout */
.location-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.75rem;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    position: relative;
    grid-gap: 1rem;
}

.location-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.location-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100%;
    margin: 0 auto;
}

.location-image {
    width: 7rem;
    height: 7rem;
    border: 1px solid #ddd;
    border-radius: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-card:hover .location-image {
    transform: scale(1.08);
}

.location-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.location-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #191919;
    margin-bottom: 1rem;
}

.location-address {
    color: #2b2a2a;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.location-address i {
    color: #191919;
    margin-top: 0.3rem;
    flex-shrink: 0;
    font-size: 1.15rem;
    opacity: .3;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 107, 0.3));
}

.map-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #191919 0%, #363535 100%);
    color: white;
    text-decoration: none;
    padding: 1rem 1.25rem;
    border-radius: 15px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.70rem;
    width: auto;
    align-self: flex-start;
    border: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.map-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.map-button:hover::before {
    left: 100%;
}

.map-button:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #363535 0%, #191919 100%);
    color: white;
    text-decoration: none;
}

.map-button i {
    font-size: .85rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.no-image {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 3.5rem;
    height: 100%;
    width: 100%;
    position: relative;
}

.no-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.no-image i {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-size: 1.2rem;
    display: none;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

/* Error/Success Messages */
.alert {
    font-family: 'Tajawal', Arial, sans-serif;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 500;
}

.alert-danger {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-info {
    background: #bee3f8;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .search-box {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }

    .navbar {
        background-color: rgba(65, 36, 20, 0.95) !important;
        /* More opaque on mobile */
    }
}

@media (max-width: 480px) {

    .page-header {
        padding: 2rem 0 1rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fade in animation for cards */
.location-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .locations-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 425px) {
    .locations-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}