/**
 * Superior Surface Engineering - Custom Theme Styles
 * ใช้ร่วมกับ Tailwind CSS CDN
 * 
 * @package Superior_Theme
 * @version 1.0.0
 */

/* ========================================
   1. Base & Typography
   ======================================== */
:root {
    --color-primary: #1e40af;
    --color-secondary: #8b5cf6;
    --color-primary-dark: #1e3a8a;
    --color-secondary-dark: #7c3aed;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   2. Header Styles
   ======================================== */
#site-header.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#site-header.scrolled .nav-link {
    color: #1e3a8a !important;
}

#site-header.scrolled .nav-link:hover {
    color: #2563eb !important;
}

#site-header.scrolled #lang-toggle {
    color: #1e3a8a !important;
}

/* Submenu Dropdown */
.nav-item-wrapper:hover .submenu-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
}

.submenu-dropdown {
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* ========================================
   3. Language Dropdown
   ======================================== */
#lang-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ========================================
   4. Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseSlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

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

.animate-fade-in {
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.scroll-reveal:nth-child(2) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.45s; }

/* ========================================
   5. Gradient Text (for browsers that don't support bg-clip)
   ======================================== */
.bg-clip-text {
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent;
}

/* ========================================
   6. Mobile Menu
   ======================================== */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.active {
    display: block !important;
}

.mobile-submenu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mobile-submenu.active {
    display: block !important;
    max-height: 500px;
}

.mobile-submenu-toggle svg.rotated {
    transform: rotate(180deg);
}

/* ========================================
   7. Cards & Hover Effects
   ======================================== */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

.group:hover .group-hover\:translate-x-2 {
    transform: translateX(0.5rem);
}

.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

/* ========================================
   8. Utilities
   ======================================== */

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Selection */
::selection {
    background: rgba(30, 64, 175, 0.2);
    color: #1e3a8a;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   9. WordPress Specific
   ======================================== */

/* Remove default WordPress margins */
.entry-content > * {
    margin-left: auto;
    margin-right: auto;
}

/* Pagination styling */
.nav-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.2s;
    color: #1e40af;
    border: 2px solid #e2e8f0;
}

.nav-links .page-numbers.current {
    background: linear-gradient(to right, #1e40af, #8b5cf6);
    color: white;
    border-color: transparent;
}

.nav-links .page-numbers:hover:not(.current) {
    background: #eff6ff;
    border-color: #1e40af;
}

/* ========================================
   10. Print Styles
   ======================================== */
@media print {
    #site-header,
    footer,
    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
