/* Government Website Styles for Police Station */
:root {
    --brown: #6b4c3b;
    --maroon: #6a1b1b;
    --white: #ffffff;
    
    /* Government Color Scheme */
    --site-blue: #1e40af;
    --site-hover: #1d4ed8;
    --gov-blue: #1e40af;
    --gov-blue-light: #3b82f6;
    --gov-blue-dark: #1e3a8a;
    --gov-navy: #164e63;
    --gov-gold: #f59e0b;
    --gov-red: #dc2626;
    --gov-green: #16a34a;
    --gov-purple: #9333ea;
    --gov-orange: #ea580c;
    
    /* Performance & Accessibility Variables */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Icon Fallback System */
.icon-fallback {
    position: relative;
}

.icon-fallback::before {
    content: "■";
    display: inline-block;
    color: #6b7280;
    font-family: system-ui, -apple-system, sans-serif;
}

.icon-fallback i {
    position: absolute;
    left: 0;
    top: 0;
}

/* Font Awesome Loading States */
[class*="fa-"]:not(.fa-loaded) {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

[class*="fa-"].fa-loaded {
    opacity: 1;
}

/* Performance: Reduce Layout Shifts */
.icon-placeholder {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: #e5e7eb;
    border-radius: 2px;
}

/* Ensure consistent icon sizing */
.fas, .far, .fab, .fal {
    width: 1em;
    text-align: center;
}

/* Section Padding */
.section-padding {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 3rem 0;
    }
}

/* Government Official Shadows */
.official-shadow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.official-shadow:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 16px 20px -12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease-in-out;
}

/* Government Service Cards */
.gov-service-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gov-service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: var(--gov-blue);
}

/* Thai Pattern Background */
.thai-pattern {
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(30, 64, 175, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 163, 74, 0.1) 0%, transparent 50%);
}

/* Government Animations */
@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes flag-wave {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

@keyframes government-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(30, 64, 175, 0.3); }
    50% { box-shadow: 0 0 40px rgba(30, 64, 175, 0.6); }
}

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

.animate-flag-wave {
    animation: flag-wave 6s ease-in-out infinite;
}

.animate-government-glow {
    animation: government-glow 4s ease-in-out infinite;
}

/* Official Badge Styles */
.official-badge {
    background: linear-gradient(135deg, var(--gov-blue), var(--gov-blue-dark));
    border: 2px solid var(--gov-gold);
    position: relative;
}

.official-badge::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--gov-gold), var(--gov-blue), var(--gov-gold));
    border-radius: inherit;
    z-index: -1;
}

/* Hero Section Enhancements */
.hero-gradient {
    background: linear-gradient(135deg, 
        var(--gov-blue) 0%, 
        var(--gov-navy) 35%, 
        var(--gov-blue-dark) 100%);
}

.hero-pattern {
    background-image: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M30 30c0-11.046-8.954-20-20-20s-20 8.954-20 20 8.954 20 20 20 20-8.954 20-20zm20 0c0-11.046-8.954-20-20-20s-20 8.954-20 20 8.954 20 20 20 20-8.954 20-20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Government Form Styles */
.gov-input {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.gov-input:focus {
    border-color: var(--gov-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

.gov-button {
    background: linear-gradient(135deg, var(--gov-blue), var(--gov-blue-dark));
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gov-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.4);
}

.gov-button:active {
    transform: translateY(0);
}

/* News Card Enhancements */
.news-card {
    background: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--gov-blue);
}

.news-card-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image {
    transform: scale(1.05);
}

/* Performance Card Styles */
.performance-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.performance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: left 0.5s ease;
}

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

.performance-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--gov-blue);
}

/* ตัวอย่างใช้ตัวแปรสีใน CSS ปกติ */
body {
    background-color: var(--white);
    color: var(--brown);
}

/* ตัวอย่างคลาสเสริมถ้าต้องการ */
.border-maroon {
    border-color: var(--maroon);
}

.bg-brown {
    background-color: var(--brown);
}

.text-maroon {
    color: var(--maroon);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .section-padding {
        padding: 4rem 0;
    }
    
    .hero-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 3rem 0;
    }
    
    .gov-service-card {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .section-padding {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .gov-service-card {
        padding: 1rem;
    }
}

/* Print Styles for Government Documents */
@media print {
    .gov-service-card,
    .news-card,
    .performance-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .official-shadow {
        box-shadow: none;
    }
    
    .animate-gentle-pulse,
    .animate-flag-wave,
    .animate-government-glow {
        animation: none;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .animate-gentle-pulse,
    .animate-flag-wave,
    .animate-government-glow,
    .gov-service-card,
    .news-card,
    .performance-card {
        animation: none;
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --gov-blue: #000080;
        --gov-blue-light: #0066cc;
        --gov-blue-dark: #000066;
    }
    
    .gov-service-card,
    .news-card,
    .performance-card {
        border-width: 2px;
        border-color: #000;
    }
}
