/*
 * Master Stylesheet for TopTenAIAgents.co.uk
 * Version: 1.0
 * Date: 21 June 2025
 * This file contains all custom styles and theme overrides for the site.
*/

/* --- GLOBAL STYLES & DEFAULTS --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb; /* gray-50 */
    color: #374151; /* gray-700 */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-top: 80px; /* Default padding for fixed header */
}

a {
    color: #2563eb; /* blue-600 */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1d4ed8; /* blue-700 */
    text-decoration: underline;
}

/* --- LAYOUT & SECTION STYLING --- */
.section-title {
    color: #111827; /* gray-900 */
    font-weight: 800; /* extrabold */
}

.glassmorphic-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(200, 200, 200, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease;
}

.glassmorphic-header.header-hidden {
    transform: translateY(-100%);
}

.glassmorphic-header.header-scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Body padding is already set in global styles above */

/* Mobile-specific header adjustments */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .glassmorphic-header {
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    .glassmorphic-header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-top: 75px;
    }
}

/* Enhanced mobile touch targets and interactions */
@media (max-width: 768px) {
    /* Ensure all clickable elements meet minimum touch target size */
    a, button, .cta-button, .mobile-menu-button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile navigation improvements */
    .glassmorphic-header nav a {
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Mobile menu button improvements */
    #mobile-menu-button {
        padding: 8px;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }
    
    #mobile-menu-button:hover,
    #mobile-menu-button:focus {
        background-color: rgba(59, 130, 246, 0.1);
    }
    
    /* Mobile menu improvements */
    #mobile-menu {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #mobile-menu a {
        font-size: 16px;
        padding: 16px 24px;
        border-bottom: 1px solid #f3f4f6;
        transition: background-color 0.2s ease;
    }
    
    #mobile-menu a:hover,
    #mobile-menu a:focus {
        background-color: #f8fafc;
    }
    
    /* Card improvements for mobile */
    .feature-card, .blog-card, .list-card, .category-card, .review-card {
        margin-bottom: 16px;
        border-radius: 12px;
    }
    
    /* Button improvements for mobile */
    .cta-button, .cta-button-card {
        padding: 12px 24px;
        font-size: 16px;
        border-radius: 12px;
        font-weight: 600;
    }
    
    /* Text improvements for mobile readability */
    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; }
    p { font-size: 16px; line-height: 1.6; }
    
    /* Form improvements for mobile */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
    }
}

/* Tablet-specific touch improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Touch targets for tablet */
    a, button, .cta-button {
        min-height: 40px;
        min-width: 40px;
    }
    
    .glassmorphic-header nav a {
        padding: 10px 14px;
        font-size: 15px;
    }
}

/* Touch device enhancements */
.touch-device .touch-active {
    transform: scale(0.98);
    opacity: 0.8;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.touch-device .feature-card.touch-active,
.touch-device .blog-card.touch-active,
.touch-device .list-card.touch-active,
.touch-device .category-card.touch-active,
.touch-device .review-card.touch-active {
    transform: scale(0.98) translateY(2px);
    box-shadow: 0 5px 10px -2px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.touch-device .cta-button.touch-active,
.touch-device .cta-button-card.touch-active {
    transform: scale(0.96);
}

/* Improved focus states for accessibility */
a:focus, button:focus, .cta-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom viewport height for mobile browsers */
.mobile-vh {
    height: calc(var(--vh, 1vh) * 100);
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Improve text selection on mobile */
::selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: inherit;
}

::-moz-selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: inherit;
}

.hero-section {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 70%, #3b82f6 100%);
    color: white;
}

/* --- CARD COMPONENT STYLES --- */
.feature-card, .blog-card, .list-card, .category-card, .review-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.feature-card:hover, .blog-card:hover, .list-card:hover, .category-card:hover, .review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

.blog-card-image-container, .list-card-image-container {
    height: 200px;
    background-color: #e5e7eb;
}
.blog-card-image-container img, .list-card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-content, .list-card-content, .review-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* --- BUTTON STYLES --- */
.cta-button {
    background-color: #f59e0b; 
    color: #422006; 
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
    border-radius: 9999px;
    padding: 0.8rem 1.8rem;
    font-weight: 600;
}
.cta-button:hover {
    background-color: #d97706;
    transform: scale(1.05);
}

.cta-button-black-friday {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    color: #dc2626;
    border: 2px solid #dc2626;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    animation: blackFridayPulse 2s ease-in-out infinite;
}

.cta-button-black-friday:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    color: #ef4444;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    text-decoration: none;
}

@keyframes blackFridayPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    }
    50% {
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.5);
    }
}

.cta-button-review {
    background-color: #3b82f6;
    color: white;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.cta-button-review:hover {
    background-color: #2563eb;
    color: white;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

.cta-button-review.cta-button-secondary {
    background-color: #6b7280;
    color: white;
}

.cta-button-review.cta-button-secondary:hover {
    background-color: #4b5563;
    color: white;
}

.cta-button-card {
    background-color: #3b82f6; 
    color: white;
    transition: background-color 0.3s ease, transform 0.2s ease;
    padding: 0.5rem 1rem; 
    border-radius: 9999px; 
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    display: inline-block; 
    margin-top: auto; 
}
.cta-button-card:hover {
    background-color: #2563eb; 
    transform: scale(1.05);
}

/* --- CONTENT & TYPOGRAPHY RESTORATION --- */
main p, .post-content p, .review-content p {
    margin-bottom: 1.25rem; /* Equivalent to mb-5 in Tailwind */
    line-height: 1.75;
}

.post-content h2, .review-content h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #d1d5db; /* Default border color */
}

/* --- ANIMATION --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE IMPROVEMENTS --- */
/* Make images responsive by default */
img {
    max-width: 100%;
    height: auto;
}

header img[src="/assets/icons/logo.png"].w-9 {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}

/* Make tables responsive */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Improve mobile typography */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem !important;
    }
    h2 {
        font-size: 1.5rem !important;
    }
    h3 {
        font-size: 1.25rem !important;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --- THEME OVERRIDE FOR SPECIFIC PAGE CATEGORIES --- */
/* Example: For a review page in the "Lead Generation" category, the body tag should have class="page-theme-lead-gen" */

.page-theme-lead-gen .review-content h2 { border-bottom-color: #10b981; }
.page-theme-sme .review-content h2 { border-bottom-color: #8b5cf6; }
.page-theme-customer-service .review-content h2 { border-bottom-color: #ef4444; }
/* ... etc. for all other themes ... */
/* Custom Styles for Search Result Highlighting */
mark, .search-query-highlight {
    background-color: #dbeafe; /* A light blue background */
    color: #1e40af; /* A dark blue text color */
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- COOKIE CONSENT BANNER CUSTOMIZATION --- */
#cc-main {
    font-family: 'Inter', sans-serif !important;
}

#cm {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98)) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-top: 2px solid #2563eb !important;
    box-shadow: 0 -4px 24px rgba(37, 99, 235, 0.1) !important;
}

#cm .cm__desc,
#cm .cc-link {
    color: #374151 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

#cm .cc-link {
    color: #2563eb !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
}

#cm .cc-link:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

#cm button {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
}

#cm .cm__btn-primary {
    background-color: #2563eb !important;
    color: white !important;
    border: none !important;
}

#cm .cm__btn-primary:hover {
    background-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

#cm .cm__btn-secondary {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border: none !important;
}

#cm .cm__btn-secondary:hover {
    background-color: #e5e7eb !important;
}

#s-bl #s-ttl {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
}

#s-inr {
    background-color: #ffffff !important;
    border-radius: 1rem !important;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.15) !important;
}

.c-tgl {
    border: 1px solid #e5e7eb !important;
    background-color: #ffffff !important;
    border-radius: 0.75rem !important;
    padding: 1.25rem !important;
    margin-bottom: 1rem !important;
    transition: all 0.2s ease !important;
}

.c-tgl:hover {
    border-color: #2563eb !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1) !important;
}

.c-tgl .c-t-cn {
    color: #111827 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

.c-tgl .c-desc {
    color: #4b5563 !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    margin-top: 0.5rem !important;
}

.c-tgl input[type="checkbox"].c-tgl-inp {
    appearance: none !important;
    width: 3rem !important;
    height: 1.5rem !important;
    background-color: #d1d5db !important;
    border-radius: 9999px !important;
    position: relative !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.c-tgl input[type="checkbox"].c-tgl-inp:checked {
    background-color: #2563eb !important;
}

.c-tgl input[type="checkbox"].c-tgl-inp::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    background-color: white !important;
    border-radius: 50% !important;
    transition: transform 0.2s ease !important;
}

.c-tgl input[type="checkbox"].c-tgl-inp:checked::after {
    transform: translateX(1.5rem) !important;
}

.c-tgl input[type="checkbox"].c-tgl-inp:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

#s-bns {
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 1.5rem !important;
}

#s-bns button {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
}

#s-bns .c-bn {
    background-color: #2563eb !important;
    color: white !important;
}

#s-bns .c-bn:hover {
    background-color: #1d4ed8 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

@media (max-width: 768px) {
    #cm {
        padding: 1.25rem !important;
    }
    
    #s-inr {
        max-width: 95vw !important;
        margin: 1rem !important;
    }
    
    #s-bl,
    #s-cnt,
    #s-bns {
        padding: 1rem !important;
    }
    
    #cm .cm__btns {
        flex-direction: column !important;
    }
    
    #cm button {
        width: 100% !important;
        text-align: center !important;
    }
}