/* ========================================
   SHAHIN AUTO SERVICE - CUSTOM CSS
   World-Class Styling & Animations
   ======================================== */

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

/* ===== ROOT VARIABLES ===== */
:root {
    --shahin-yellow: #FFD700;
    --shahin-blue: #1E40AF;
    --shahin-light-blue: #3B82F6;
    --shahin-dark-blue: #1E3A8A;
    --shahin-gold: #FFA500;
    --shahin-silver: #C0C0C0;
    
    --font-vazir: 'Vazirmatn', 'Vazir', Tahoma, Arial, sans-serif;
    
    --shadow-shahin: 0 10px 25px -5px rgba(30, 64, 175, 0.1), 0 10px 10px -5px rgba(30, 64, 175, 0.04);
    --shadow-shahin-lg: 0 20px 25px -5px rgba(30, 64, 175, 0.1), 0 10px 10px -5px rgba(30, 64, 175, 0.04);
    --shadow-shahin-xl: 0 25px 50px -12px rgba(30, 64, 175, 0.25);
    --shadow-yellow-glow: 0 0 20px rgba(255, 215, 0, 0.3);
    --shadow-blue-glow: 0 0 20px rgba(30, 64, 175, 0.3);
}

/* Base Styles */
* {
    box-sizing: border-box;
    font-family: var(--font-vazir);
}

body {
    font-family: var(--font-vazir);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    letter-spacing: 0.5px;
    scroll-behavior: smooth;
}

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
}

.ltr {
    direction: ltr;
    text-align: left;
}

/* ===== CUSTOM ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeInDown {
    0% { 
        opacity: 0; 
        transform: translateY(-30px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    0% { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-10px); 
    }
}

@keyframes glow {
    0% { 
        box-shadow: 0 0 5px var(--shahin-yellow), 0 0 10px var(--shahin-yellow), 0 0 15px var(--shahin-yellow); 
    }
    100% { 
        box-shadow: 0 0 10px var(--shahin-yellow), 0 0 20px var(--shahin-yellow), 0 0 30px var(--shahin-yellow); 
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== ANIMATION CLASSES ===== */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-bounce-slow {
    animation: bounce 2s infinite;
}

.animate-pulse-slow {
    animation: pulse 3s infinite;
}

/* ===== TYPOGRAPHY ENHANCEMENTS ===== */
.font-vazir {
    font-family: var(--font-vazir) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--shahin-blue), var(--shahin-light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-yellow {
    background: linear-gradient(135deg, var(--shahin-yellow), var(--shahin-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== CUSTOM SHADOWS ===== */
.shadow-shahin {
    box-shadow: var(--shadow-shahin);
}

.shadow-shahin-lg {
    box-shadow: var(--shadow-shahin-lg);
}

.shadow-shahin-xl {
    box-shadow: var(--shadow-shahin-xl);
}

.shadow-yellow-glow {
    box-shadow: var(--shadow-yellow-glow);
}

.shadow-blue-glow {
    box-shadow: var(--shadow-blue-glow);
}

/* ===== GRADIENT BACKGROUNDS ===== */
.gradient-bg {
    background: linear-gradient(135deg, #FFD700 0%, #1E40AF 100%);
}

.gradient-bg-reverse {
    background: linear-gradient(135deg, #1E40AF 0%, #FFD700 100%);
}

.gradient-bg-shahin {
    background: linear-gradient(135deg, var(--shahin-yellow), var(--shahin-blue));
}

.gradient-bg-shahin-blue {
    background: linear-gradient(135deg, var(--shahin-blue), var(--shahin-light-blue));
}

.gradient-bg-shahin-yellow {
    background: linear-gradient(135deg, var(--shahin-yellow), var(--shahin-gold));
}

.gradient-text {
    background: linear-gradient(135deg, #FFD700, #1E40AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== GLASSMORPHISM EFFECTS ===== */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(8px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #1E40AF, #3B82F6);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1E3A8A, #2563EB);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #FFD700, #F59E0B);
    color: #1F2937;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1E40AF;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.loading-spinner-sm {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1E40AF;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* Mobile Menu */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

.dark-mode .bg-white {
    background-color: #2d2d2d !important;
    color: #ffffff;
}

.dark-mode .text-gray-800 {
    color: #ffffff !important;
}

.dark-mode .text-gray-600 {
    color: #d1d5db !important;
}

.dark-mode .text-gray-500 {
    color: #9ca3af !important;
}

.dark-mode .bg-gray-100 {
    background-color: #374151 !important;
}

.dark-mode .bg-gray-50 {
    background-color: #4b5563 !important;
}

/* Text Shadow */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.text-shadow-lg {
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.7);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1E40AF, #3B82F6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1E3A8A, #2563EB);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
    resize: vertical;
    min-height: 120px;
}

.form-textarea:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Hero Section */
.hero-bg {
    background: linear-gradient(rgba(30, 64, 175, 0.7), rgba(255, 215, 0, 0.3)), url('../images/hero.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Image Hover Effects */
.image-hover {
    transition: transform 0.3s ease;
    overflow: hidden;
}

.image-hover:hover img {
    transform: scale(1.1);
}

.image-hover img {
    transition: transform 0.3s ease;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll;
        min-height: 80vh;
    }
    
    .card-hover:hover {
        transform: translateY(-4px);
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero-bg {
        min-height: 70vh;
    }
    
    .text-shadow {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .card-hover {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
.focus-visible:focus {
    outline: 2px solid #1E40AF;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card-hover {
        border: 2px solid #000;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid #000;
    }
}

/* Appointment System Styles */
.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::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.5s;
    z-index: 1;
}

.service-card:hover::before {
    left: 100%;
}

.service-card.selected {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(30, 64, 175, 0.4);
    border: 2px solid var(--shahin-blue);
}

.time-slot {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-slot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(30, 64, 175, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.time-slot:hover::before {
    width: 100%;
    height: 100%;
}

.time-slot.selected {
    background: linear-gradient(135deg, var(--shahin-blue), var(--shahin-light-blue));
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

.step-indicator {
    position: relative;
    transition: all 0.3s ease;
}

.step-indicator.active {
    animation: pulse 2s infinite;
}

.step-indicator.completed {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: none;
}

.step-indicator.completed::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

/* Step Progress Animation */
@keyframes stepProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.step-progress-bar {
    animation: stepProgress 0.8s ease-out;
}

/* Form Field Focus Effects */
.form-field-group {
    position: relative;
    transition: all 0.3s ease;
}

.form-field-group:focus-within {
    transform: translateY(-2px);
}

.form-field-group:focus-within .form-label {
    color: var(--shahin-blue);
    transform: scale(0.95);
}

.form-label {
    transition: all 0.3s ease;
    transform-origin: right top;
}

/* Modal Animation */
.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-exit {
    animation: modalExit 0.2s ease-in;
}

@keyframes modalExit {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4CAF50;
    stroke-miterlimit: 10;
    margin: 0 auto;
    box-shadow: inset 0px 0px 0px #4CAF50;
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.success-checkmark circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4CAF50;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark path {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #4CAF50;
    }
}

/* Loading Spinner Enhancement */
.loading-spinner-enhanced {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--shahin-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--shahin-blue), var(--shahin-light-blue));
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(30, 64, 175, 0.4);
}

.fab:active {
    transform: scale(0.95);
}

/* Notification Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
    border-right: 4px solid var(--shahin-blue);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-right-color: #10b981;
}

.toast.error {
    border-right-color: #ef4444;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .service-card {
        margin-bottom: 1rem;
    }
    
    .time-slot {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .step-indicator {
        width: 8px;
        height: 8px;
        font-size: 12px;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .service-card::before,
    .time-slot::before {
        display: none;
    }
}
