/* Universal CSS - Consolidated styles for the entire site */

/* ========================================
   LAYOUT AND POSITIONING
   ======================================== */

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    transition: top 0.3s;
    z-index: 2000;
}

.skip-link:focus {
    top: 0;
}

/* Bootstrap Menu Overrides */
.navbar {
    position: relative;
    z-index: 1030;
}

.navbar-collapse {
    z-index: 1030;
}

.dropdown-menu {
    z-index: 1030;
}

.dropdown-submenu .dropdown-menu {
    z-index: 1030;
}

/* Footer styles */
body {
    padding-bottom: var(--footer-height, 60px);
}

#main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
    z-index: 1020;
}

header { 
    position: relative;
    z-index: 1025;
}

/* Main content */
main {
    position: relative;
    z-index: 1010;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus indicators for accessibility */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* ========================================
   BACKGROUND ANIMATIONS
   ======================================== */

/* Home page animated background */
#animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 30%, #581c87 70%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
}

#animated-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

#animated-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 25s linear infinite;
    z-index: 1;
}

/* ========================================
   PARTICLE SYSTEMS
   ======================================== */

/* Header particles container */
#header-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1026;
}

/* Header particle elements */
.header-particle-1 {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: float1 4s ease-in-out infinite;
}

.header-particle-2 {
    position: absolute;
    top: 60%;
    left: 30%;
    width: 6px;
    height: 6px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: float2 5s ease-in-out infinite;
}

.header-particle-3 {
    position: absolute;
    top: 40%;
    left: 70%;
    width: 10px;
    height: 10px;
    background: #06b6d4;
    border-radius: 50%;
    animation: float3 3s ease-in-out infinite;
}

.header-particle-4 {
    position: absolute;
    top: 80%;
    left: 50%;
    width: 7px;
    height: 7px;
    background: #3b82f6;
    border-radius: 50%;
    animation: float1 6s ease-in-out infinite;
}

.header-particle-5 {
    position: absolute;
    top: 30%;
    left: 90%;
    width: 5px;
    height: 5px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: float2 4.5s ease-in-out infinite;
}

/* Logo styling */
.site-logo {
    max-height: 40px;
    width: auto;
}

/* Footer particles container */
#footer-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1021;
}

/* Footer particle elements */
.footer-particle-1 {
    position: absolute;
    top: 25%;
    left: 15%;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    animation: float1 5s ease-in-out infinite;
}

.footer-particle-2 {
    position: absolute;
    top: 70%;
    left: 40%;
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    animation: float2 4s ease-in-out infinite;
}

.footer-particle-3 {
    position: absolute;
    top: 45%;
    left: 80%;
    width: 5px;
    height: 5px;
    background: #74c0fc;
    border-radius: 50%;
    animation: float3 6s ease-in-out infinite;
}

.footer-particle-4 {
    position: absolute;
    top: 60%;
    left: 65%;
    width: 7px;
    height: 7px;
    background: #fbbf24;
    border-radius: 50%;
    animation: float1 3.5s ease-in-out infinite;
}

/* Footer content positioning */
.footer-content {
    position: relative;
    z-index: 1022;
}

/* Footer search form */
.footer-search-form {
    max-width: 250px;
}

/* ========================================
   ANIMATIONS AND KEYFRAMES
   ======================================== */

/* Particle animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.7; }
    50% { transform: translateY(-15px) translateX(10px); opacity: 1; }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) translateX(0px) scale(1); opacity: 0.6; }
    50% { transform: translateY(-20px) translateX(-8px) scale(1.2); opacity: 0.9; }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
    50% { transform: translateY(-10px) rotate(180deg); opacity: 1; }
}

/* Background animations */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes sparkle {
    0% { transform: translateX(0); }
    100% { transform: translateX(200px); }
}

/* ========================================
   JAVASCRIPT FALLBACK STYLES
   ======================================== */

.header-fallback {
    background: radial-gradient(circle, rgba(226,232,240,0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    width: 100%;
    height: 100%;
    animation: float 10s ease-in-out infinite;
}

.header-test-fallback {
    background: red;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 10px;
    animation: bounce 2s infinite;
}

.footer-fallback {
    background: radial-gradient(circle, rgba(108,117,125,0.2) 1px, transparent 1px);
    background-size: 15px 15px;
    width: 100%;
    height: 100%;
    animation: float 12s ease-in-out infinite reverse;
}

.footer-test-fallback {
    background: yellow;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    right: 10px;
    animation: bounce 1.5s infinite;
}

/* Base styles */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}
