html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Root Variables */
:root {
    --primary-color: #ff69b4;
    --secondary-color: #ffc0cb;
    --accent-color: #ff1493;
    --dark-pink: #c71585;
    --light-pink: #ffb6c1;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --shadow: 0 10px 30px rgba(255, 105, 180, 0.3);
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #fafafa 0%, #f0f8ff 100%);
    overflow-x: hidden;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 300px;
}

.loading-logo {
    font-size: 3rem;
    color: var(--primary-color, #ff69b4);
    margin-bottom: 1rem;
}

.loading-text h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-family: 'Tajawal', sans-serif;
}

.loading-text p {
    color: #ccc;
    margin-bottom: 1.5rem;
}

.loading-progress {
    width: 100%;
}

.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color, #ff69b4), var(--secondary-color, #ffc0cb));
    height: 100%;
    transition: width 0.3s ease;
}

.percentage {
    font-size: 0.875rem;
    color: #ccc;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: #333 !important;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: var(--gradient);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::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 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="rgba(255,255,255,0.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="200" cy="200" r="150" fill="url(%23a)"/><circle cx="800" cy="300" r="100" fill="url(%23a)"/><circle cx="300" cy="700" r="120" fill="url(%23a)"/><circle cx="700" cy="800" r="80" fill="url(%23a)"/></svg>');
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    animation: slideInRight 1s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    animation: slideInLeft 1s ease-out 0.3s both;
}

.hero-buttons {
    animation: slideInUp 1s ease-out 0.6s both;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-primary {
    background: var(--gradient);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.4);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* Section Styling */
.section {
    padding: 80px 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: #333;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
    transform: translateX(-50%);
}

/* Service Cards */
.service-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: none;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.service-card:hover::before {
    left: 0;
    opacity: 0.1;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.service-card * {
    position: relative;
    z-index: 2;
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    color: var(--accent-color);
}

.service-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.service-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-duration {
    color: #888;
    font-size: 0.9rem;
}

/* Selected service card styling */
.service-card.selected {
    border: 2px solid var(--primary-color, #ff69b4) !important;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3) !important;
    transform: translateY(-5px) !important;
    background: rgba(255, 105, 180, 0.05) !important;
}

.service-card.selected .service-title {
    color: var(--primary-color, #ff69b4) !important;
}

/* Booking Form */
.booking-form {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    max-height: none;
    overflow: visible;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 105, 180, 0.25);
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Time slot styling */
.time-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.time-slot {
    min-width: 120px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.time-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.time-slot.active {
    background: var(--primary-color, #ff69b4) !important;
    border-color: var(--primary-color, #ff69b4) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4) !important;
}

.occupied-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.occupied-slots-grid .btn {
    font-size: 0.875rem;
    pointer-events: none;
    opacity: 0.7;
}

/* Modal Styling */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow);
}

.modal-header {
    background: var(--gradient);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
}

/* Success Message */
.booking-success {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.reference-number {
    background: var(--gradient);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
    color: #ffffff;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient);
}

.footer .text-light {
    color: #ffffff !important;
}

.footer .opacity-75 {
    opacity: 0.85 !important;
}

.social-links a {
    transition: var(--transition);
    color: #ffffff !important;
}

.social-links a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.working-hours div {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.working-hours div:last-child {
    border-bottom: none;
}

/* Modal and Body Scroll Fix */
body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal {
    overflow-y: auto !important;
    padding-right: 0 !important;
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-dialog-scrollable {
    max-height: calc(100vh - 3.5rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* Force body to maintain scroll capability */
html, body {
    overflow-x: hidden;
    overflow-y: auto !important;
}

/* Improved Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none !important;
}

/* Ensure body can scroll when loading is hidden */
body:not(.loading) {
    overflow: auto !important;
}

/* Enhanced booking form scroll */
.booking-form {
    max-height: none;
    overflow: visible;
}

.time-slots-container {
    min-height: 60px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f8f9fa;
}

.time-slots-container::-webkit-scrollbar {
    width: 6px;
}

.time-slots-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.time-slots-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Smooth scrolling enhancement */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
.container-fluid, .container {
    overflow-x: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .service-card {
        margin-bottom: 2rem;
    }
    
    .booking-form {
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .btn-primary,
    .btn-outline-light {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* RTL Enhancements */
[dir="rtl"] .nav-link::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

[dir="rtl"] .section-title::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background: var(--gradient) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}
