/* 
 * Seonize Website Styles
 * Optimized for PageSpeed Insights Performance
 */

/* Critical CSS for above-the-fold content */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Preload critical fonts */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    font-display: swap; /* Improve font loading performance */
}

/* Hero section styling */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Page headers */
.page-header {
    padding: 3rem 0;
    color: white;
}

.page-header h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Navigation enhancements */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--warning-color) !important;
}

/* Dropdown menu styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Content blocks styling */
.content-block {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.content-block img {
    border-radius: 0.75rem;
    transition: transform 0.3s ease;
}

.content-block img:hover {
    transform: scale(1.05);
}

/* Image optimizations for performance */
img {
    max-width: 100%;
    height: auto;
    /* Lazy loading hint for browsers */
    loading: lazy;
}

/* Critical images should not be lazy loaded */
.hero-section img,
.page-header img {
    loading: eager;
}

/* Button enhancements */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

.display-1, .display-2, .display-3, .display-4 {
    font-weight: 700;
}

/* Animation for loading performance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

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

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .content-block {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 40vh;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Performance: Reduce layout shifts */
.navbar {
    min-height: 56px;
}

/* Accessibility improvements */
.btn:focus,
.nav-link:focus,
.dropdown-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link for accessibility */
.skip-to-main, .skip-to-main-content {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0.5rem;
    z-index: 1050;
}

.skip-to-main:focus, .skip-to-main-content:focus {
    top: 0;
    color: white;
}

/* Performance: Critical CSS only for above-the-fold content */
/* Non-critical styles will be loaded asynchronously */

/* Optimizations for Core Web Vitals */
/* Largest Contentful Paint (LCP) optimization */
.hero-section,
.page-header {
    contain: layout style paint;
}

/* Cumulative Layout Shift (CLS) prevention */
.card-img-top {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* First Input Delay (FID) optimization */
.btn,
.nav-link,
.dropdown-toggle {
    touch-action: manipulation;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Print styles for better accessibility */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .hero-section,
    .page-header {
        background: none !important;
        color: black !important;
    }
}

/* GDPR Consent Banner Styles */
.gdpr-consent-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gdpr-consent-banner.show {
    opacity: 1;
    visibility: visible;
}

.gdpr-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.gdpr-consent-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    z-index: 1;
}

.gdpr-consent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.gdpr-consent-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.gdpr-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.gdpr-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.gdpr-consent-body {
    padding: 0 2rem 2rem;
}

.gdpr-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.gdpr-consent-categories {
    margin-bottom: 1.5rem;
}

.gdpr-consent-category {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.gdpr-consent-category:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.gdpr-category-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.gdpr-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.gdpr-consent-actions .btn {
    flex: 1;
    min-width: auto;
}

.gdpr-consent-links {
    text-align: center;
    font-size: 0.9rem;
}

.gdpr-consent-links a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.gdpr-consent-links a:hover {
    color: var(--warning-color);
}

/* Mobile responsive for GDPR banner */
@media (max-width: 768px) {
    .gdpr-consent-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .gdpr-consent-header,
    .gdpr-consent-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .gdpr-consent-actions {
        flex-direction: column;
    }
    
    .gdpr-consent-actions .btn {
        flex: none;
    }
}

/* Cookie settings link in footer */
.footer-consent-link {
    display: inline-block;
    margin-left: 0.5rem;
}
