/* Custom CSS for Mysore Appliance Repair Website */

/* CSS Reset and Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

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

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

@keyframes bounceSubtle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInDelay 1s ease-out 0.3s both;
}

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

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Enhanced Button Styles */
.btn-primary {
    @apply bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold transition-all duration-300 transform hover:bg-blue-700 hover:scale-105 hover:shadow-lg;
}

.btn-secondary {
    @apply bg-white text-blue-600 border-2 border-blue-600 px-6 py-3 rounded-lg font-semibold transition-all duration-300 hover:bg-blue-600 hover:text-white hover:shadow-lg;
}

.btn-success {
    @apply bg-green-500 text-white px-6 py-3 rounded-lg font-semibold transition-all duration-300 hover:bg-green-600 hover:shadow-lg;
}

/* Custom Form Styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-300;
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-300 appearance-none bg-white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Card Hover Effects */
.card-hover {
    @apply transition-all duration-300 transform hover:scale-105 hover:shadow-xl;
}

.card-hover:hover {
    transform: translateY(-5px);
}

/* Service Card Styles */
.service-card {
    @apply bg-white rounded-lg shadow-lg overflow-hidden transition-all duration-300 hover:shadow-xl;
}

.service-card:hover {
    transform: translateY(-8px);
}

.service-card img {
    @apply transition-transform duration-300;
}

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

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    @apply cursor-pointer overflow-hidden rounded-lg shadow-lg transition-all duration-300 hover:shadow-xl;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    @apply w-full h-full object-cover transition-transform duration-300;
}

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

/* Testimonial Styles */
.testimonial-card {
    @apply bg-gray-50 p-6 rounded-lg shadow-lg transition-all duration-300 hover:shadow-xl hover:bg-white;
}

/* Loading Spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Mobile Menu Transition */
.mobile-menu-transition {
    transition: all 0.3s ease-in-out;
}

/* Gradient Backgrounds */
.gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-overlay {
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
}

/* Icon Styles */
.icon-bounce {
    @apply transition-transform duration-300;
}

.icon-bounce:hover {
    transform: translateY(-3px);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
    @apply absolute top-0 left-0 bg-blue-600 text-white px-4 py-2 rounded-br-lg transform -translate-y-full focus:translate-y-0 transition-transform duration-300 z-50;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        @apply text-gray-800;
    }
    
    .bg-gray-50 {
        @apply bg-white;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .bg-blue-600 {
        background: #000 !important;
        color: #fff !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .dark-mode-support .bg-white {
        background-color: #2d2d2d;
    }
    
    .dark-mode-support .text-gray-800 {
        color: #ffffff;
    }
    
    .dark-mode-support .text-gray-600 {
        color: #cccccc;
    }
}

/* Additional Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.box-shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
}

/* Performance Optimizations */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Custom Grid Layouts */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* Enhanced Button Hover States */
.btn-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Custom Border Styles */
.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(45deg, #3b82f6, #8b5cf6) 1;
}

/* Sticky Elements */
.sticky-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Success States */
.success-message {
    @apply bg-green-50 border border-green-200 text-green-800 p-4 rounded-lg;
}

.error-message {
    @apply bg-red-50 border border-red-200 text-red-800 p-4 rounded-lg;
}

/* Custom Spacing */
.section-padding {
    @apply py-16 px-4;
}

@media (min-width: 768px) {
    .section-padding {
        @apply py-20 px-6;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        @apply py-24 px-8;
    }
}
