/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Form Styles */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Card Styles */
.card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Alert Styles */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Static Ads Styles */
.static-ad-header img,
.static-ad-footer img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.static-ad-header img:hover,
.static-ad-footer img:hover {
    transform: scale(1.02);
}

/* Specific styles for header and footer static ads */
.static-ad-header {
    margin-bottom: 1rem;
}

.static-ad-header img {
    max-height: 300px;
}

/* Make header ads same style as sidebar ads */
.static-ad-header {
    height: 300px;
}

/* Override object-cover for static ads - now use cover like sidebar ads */
.static-ad-header img,
.static-ad-footer img {
    object-fit: cover !important;
}

/* Enhanced Mobile responsive styles */
@media (max-width: 768px) {
    .static-ad-header {
        height: 200px;
    }
    
    .static-ad-header img {
        max-height: 200px;
        height: 200px;
    }
    
    /* Improved mobile spacing */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Better mobile typography */
    h1 {
        font-size: 1.875rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4;
    }
    
    /* Enhanced mobile buttons */
    .btn, button {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improved mobile cards */
    .card, .bg-white.rounded-xl {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    
    /* Better mobile grid spacing */
    .grid {
        gap: 1rem;
    }
    
    /* Enhanced mobile images */
    img {
        border-radius: 0.5rem;
    }
    
    /* Improved mobile carousel */
    .carousel-container {
        height: 300px;
    }
    
    .carousel-slide {
        height: 300px;
    }
    
    .carousel-image {
        height: 300px;
    }
    
    /* Better mobile navigation */
    .nav {
        padding: 0.5rem 0;
    }
    
    /* Enhanced mobile forms */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Improved mobile touch targets */
    a, button, .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .static-ad-header {
        height: 150px;
    }
    
    .static-ad-header img {
        max-height: 150px;
        height: 150px;
    }
    
    .carousel-container {
        height: 250px;
    }
    
    .carousel-slide {
        height: 250px;
    }
    
    .carousel-image {
        height: 250px;
    }
    
    /* Better small mobile typography */
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    /* Improved small mobile spacing */
    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .py-12 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .py-8 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Enhanced Mobile Touch Interactions */
@media (max-width: 768px) {
    /* Remove hover effects on touch devices */
    *:hover {
        transition: none !important;
    }
    
    /* Better touch feedback */
    .btn:hover, button:hover, a:hover {
        transform: scale(1.02);
        opacity: 0.9;
    }
    
    /* Improved mobile scrolling */
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Better mobile focus states */
    button:focus, a:focus, input:focus, textarea:focus, select:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
    
    /* Enhanced mobile animations */
    .fade-in {
        animation: fadeIn 0.3s ease-in-out;
    }
    
    .slide-up {
        animation: slideUp 0.3s ease-out;
    }
    
    /* Better mobile shadows */
    .shadow-lg {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    
    .shadow-xl {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
}

/* Mobile-specific animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Enhanced Mobile Gallery Modal */
@media (max-width: 768px) {
    #galleryModal {
        padding: 0;
    }
    
    #galleryImageContainer {
        padding: 1rem;
    }
    
    #galleryThumbnailsContainer {
        padding: 0.5rem;
        background: rgba(0, 0, 0, 0.8);
    }
    
    #galleryThumbnails {
        gap: 0.5rem;
    }
    
    #galleryThumbnails img {
        width: 60px;
        height: 60px;
        border-radius: 0.25rem;
        opacity: 0.7;
        transition: opacity 0.2s;
    }
    
    #galleryThumbnails img.active {
        opacity: 1;
        border: 2px solid #ffffff;
    }
}

/* Mobile Agency Cards Enhancement */
@media (max-width: 768px) {
    .agency-card {
        margin-bottom: 1.5rem;
        border-radius: 1rem;
        overflow: hidden;
    }
    
    .agency-card .h-48 {
        height: 200px;
    }
    
    .agency-card .p-6 {
        padding: 1rem;
    }
    
    .agency-card .text-xl {
        font-size: 1.125rem;
    }
    
    .agency-card .text-sm {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .agency-card .btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* Mobile Category Cards Enhancement */
@media (max-width: 768px) {
    .category-card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    
    .category-card .h-40 {
        height: 160px;
    }
    
    .category-card .p-4 {
        padding: 0.75rem;
    }
    
    .category-card .text-sm {
        font-size: 0.8rem;
    }
    
    .category-card button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Mobile Pricing Section Enhancement */
@media (max-width: 768px) {
    .pricing-card {
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }
    
    .pricing-card .p-6 {
        padding: 1.5rem;
    }
    
    .pricing-card .text-4xl {
        font-size: 2rem;
    }
    
    .pricing-card .text-lg {
        font-size: 1rem;
    }
    
    .pricing-card .text-sm {
        font-size: 0.875rem;
    }
}

/* Mobile Navigation Enhancement */
@media (max-width: 768px) {
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: #ffffff;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
}

/* Mobile Loading States */
@media (max-width: 768px) {
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 0.875rem;
        color: #6b7280;
    }
}

/* Mobile Error States */
@media (max-width: 768px) {
    .error-message {
        padding: 1rem;
        margin: 0.5rem 0;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
    
    .success-message {
        padding: 1rem;
        margin: 0.5rem 0;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Additional Mobile Enhancements from Reference */
@media (max-width: 768px) {
    /* Enhanced button hover effects */
    .btn:hover, button:hover, a:hover {
        transform: translateY(-1px) scale(1.02);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    /* Improved card hover effects */
    .agency-card:hover, .category-card:hover, .pricing-card:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }
    
    /* Better image hover effects */
    img:hover {
        transform: scale(1.05);
        transition: transform 0.3s ease;
    }
    
    /* Enhanced loading states */
    .animate-spin {
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    
    /* Better focus indicators */
    button:focus-visible, a:focus-visible {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
        border-radius: 0.25rem;
    }
    
    /* Improved transitions */
    * {
        transition-duration: 0.2s;
        transition-timing-function: ease-out;
    }
    
    /* Better text selection */
    ::selection {
        background-color: #3b82f6;
        color: white;
    }
    
    /* Improved scrollbar for mobile */
    ::-webkit-scrollbar {
        width: 6px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f5f9;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }
}

/* Enhanced Mobile Card Layouts and Spacing */
@media (max-width: 768px) {
    /* Better card spacing and layout */
    .agency-card, .category-card, .pricing-card {
        margin-bottom: 1.25rem;
        border-radius: 1.125rem;
        overflow: hidden;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Enhanced agency cards */
    .agency-card {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid #e2e8f0;
    }
    
    .agency-card:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        border-color: #cbd5e1;
    }
    
    /* Enhanced category cards */
    .category-card {
        background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
        border: 1px solid #f3f4f6;
    }
    
    .category-card:hover {
        transform: translateY(-3px) scale(1.03);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        border-color: #e5e7eb;
    }
    
    /* Enhanced pricing cards */
    .pricing-card {
        background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
        border: 1px solid #e5e7eb;
        position: relative;
    }
    
    .pricing-card:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }
    
    /* Better mobile grid spacing */
    .grid {
        gap: 1.25rem;
    }
    
    /* Enhanced mobile images in cards */
    .agency-card img, .category-card img {
        border-radius: 0.75rem;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Better mobile typography in cards */
    .agency-card h3, .category-card h3 {
        font-size: 1.125rem;
        line-height: 1.4;
        font-weight: 700;
        color: #1f2937;
    }
    
    .agency-card p, .category-card p {
        font-size: 0.875rem;
        line-height: 1.5;
        color: #6b7280;
    }
    
    /* Enhanced mobile buttons in cards */
    .agency-card button, .category-card button {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        font-weight: 600;
        border-radius: 0.75rem;
        min-height: 48px;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Better mobile card content spacing */
    .agency-card .p-4, .category-card .p-4 {
        padding: 1rem;
    }
    
    .agency-card .p-6, .category-card .p-6 {
        padding: 1.5rem;
    }
    
    /* Enhanced mobile card shadows */
    .shadow-lg {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
    
    .shadow-xl {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
    
    /* Better mobile card borders */
    .rounded-xl {
        border-radius: 1.125rem;
    }
    
    /* Enhanced mobile card transitions */
    .agency-card, .category-card, .pricing-card {
        will-change: transform, box-shadow;
    }
    
    /* Better mobile card content layout */
    .agency-card .flex, .category-card .flex {
        gap: 0.75rem;
    }
    
    /* Enhanced mobile card image containers */
    .agency-card .h-40, .category-card .h-40 {
        height: 160px;
        border-radius: 0.875rem 0.875rem 0 0;
    }
    
    .agency-card .h-48, .category-card .h-48 {
        height: 192px;
        border-radius: 0.875rem 0.875rem 0 0;
    }
}

/* Carousel Styles */
.carousel-image {
    max-width: 100%;
    height: 400px; /* Increased height for better visibility */
    object-fit: cover; /* Same as static ads header */
    object-position: center; /* Center the image */
}

/* Carousel container adjustments */
.carousel-container {
    height: 400px; /* Increased height for better visibility */
}

.carousel-slide {
    height: 400px; /* Increased height for better visibility */
}

/* Carousel specific styles - larger images like sidebar ads */
.carousel-image {
    max-width: 100%;
    height: 400px; /* Increased height for better visibility */
    object-fit: cover; /* Same as static ads header */
    object-position: center; /* Center the image */
}

/* Carousel container adjustments */
.carousel-container {
    height: 400px; /* Increased height for better visibility */
}

.carousel-slide {
    height: 400px; /* Increased height for better visibility */
}
