/* Animated Background Styles */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, 
        rgba(59, 59, 59, 0.02) 0%, 
        rgba(59, 59, 59, 0.05) 25%, 
        rgba(59, 59, 59, 0.03) 50%, 
        rgba(59, 59, 59, 0.08) 75%, 
        rgba(59, 59, 59, 0.04) 100%), 
        #fafbfc;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Floating particles */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.shape.circle {
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(59, 59, 59, 0.08), rgba(59, 59, 59, 0.03));
}

.shape.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 26px solid rgba(59, 59, 59, 0.06);
}

.shape.square {
    background: linear-gradient(45deg, rgba(59, 59, 59, 0.06), rgba(59, 59, 59, 0.02));
    transform: rotate(45deg);
}

.shape.hexagon {
    width: 30px;
    height: 17.32px;
    background: rgba(59, 59, 59, 0.04);
    position: relative;
}

.shape.hexagon:before,
.shape.hexagon:after {
    content: "";
    position: absolute;
    width: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
}

.shape.hexagon:before {
    bottom: 100%;
    border-bottom: 8.66px solid rgba(59, 59, 59, 0.04);
}

.shape.hexagon:after {
    top: 100%;
    border-top: 8.66px solid rgba(59, 59, 59, 0.04);
}

/* Floating animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-40px) rotate(180deg);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-20px) rotate(270deg);
        opacity: 0.7;
    }
}

/* Wave animation */
.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: linear-gradient(90deg, 
        rgba(59, 59, 59, 0.02) 0%, 
        rgba(59, 59, 59, 0.04) 50%, 
        rgba(59, 59, 59, 0.02) 100%);
    border-radius: 1000px 1000px 0 0;
    animation: wave 15s linear infinite;
}

.wave:nth-child(2) {
    animation: wave 20s linear infinite reverse;
    opacity: 0.5;
    height: 80px;
}

.wave:nth-child(3) {
    animation: wave 25s linear infinite;
    opacity: 0.3;
    height: 60px;
}

@keyframes wave {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Gradient orbs */
.gradient-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(59, 59, 59, 0.06), 
        rgba(59, 59, 59, 0.03), 
        transparent 70%);
    animation: drift 30s infinite ease-in-out;
}

.orb:nth-child(1) {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 20%;
    animation-delay: -10s;
}

.orb:nth-child(3) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 30%;
    animation-delay: -20s;
}

.orb:nth-child(4) {
    width: 120px;
    height: 120px;
    top: 30%;
    right: 10%;
    animation-delay: -15s;
}

@keyframes drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Mesh gradient overlay */
.mesh-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(59, 59, 59, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 59, 59, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(59, 59, 59, 0.015) 0%, transparent 50%);
    animation: meshShift 40s ease-in-out infinite;
}

@keyframes meshShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05) rotate(1deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shape {
        animation-duration: 15s;
    }
    
    .orb {
        animation-duration: 25s;
    }
    
    .wave-container {
        height: 100px;
    }
    
    .wave {
        height: 70px;
    }
}

@media (max-width: 480px) {
    .shape {
        animation-duration: 12s;
    }
    
    .orb:nth-child(1), .orb:nth-child(2) {
        width: 100px;
        height: 100px;
    }
    
    .orb:nth-child(3), .orb:nth-child(4) {
        width: 80px;
        height: 80px;
    }
}

/* Ensure content remains readable */
html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    z-index: 1;
}

/* Ensure navbar and other important elements stay above background */
.navbar-fixed-top {
    z-index: 1000 !important;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    -webkit-transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    -moz-transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    -o-transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Smooth navbar animations - enhanced background when scrolled */
.navbar-fixed-top.scrolled {
    background-color: #0c4d96f7 !important;
    box-shadow: 0 2px 20px rgba(5, 118, 251, 0.3);
    border-bottom: 1px solid rgba(5, 118, 251, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Smooth transitions for navbar content */
.navbar-fixed-top .navbar-nav > li > a,
.navbar-fixed-top .navbar-brand,
.navbar-fixed-top .navbar-toggle .icon-bar {
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
}

/* Ensure navbar content is visible when scrolled with new blue background */
.navbar-fixed-top.scrolled .navbar-nav > li > a {
    color: #ffffff !important;
}

.navbar-fixed-top.scrolled .navbar-brand {
    color: #ffffff !important;
}

.navbar-fixed-top.scrolled .navbar-brand img {
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.navbar-fixed-top.scrolled .navbar-toggle .icon-bar {
    background-color: #ffffff !important;
}

.navbar-fixed-top.scrolled .navbar-nav > li > a:hover {
    color: #f0f0f0 !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.navbar-fixed-top .navbar-nav > li > a {
    transition: all 0.3s ease;
}

.navbar-fixed-top .navbar-brand {
    transition: all 0.3s ease;
}

/* Add smooth hover effects */
.navbar-fixed-top .navbar-nav > li > a:hover {
    transform: translateY(-1px);
    color: #3b3b3b !important;
}

.navbar-fixed-top .navbar-brand:hover {
    transform: scale(1.05);
}

/* Smooth page transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Typography & Content Styling */
body {
    font-size: 16px; /* Reduced from 18px but still larger than original ~14px */
    line-height: 1.7;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: #2c3e50;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1.2em;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

h1 { 
    font-size: 2.8em; /* ~45px reduced to ~40px */
    margin-bottom: 0.8em;
}

h2 { 
    font-size: 2.3em; /* ~37px reduced to ~33px */
    margin-bottom: 0.9em;
}

h3 { 
    font-size: 1.9em; /* ~30px reduced to ~27px */
    margin-bottom: 1em;
}

h4 { 
    font-size: 1.4em; /* ~23px reduced to ~20px */
    margin-bottom: 1.1em;
}

h5 { 
    font-size: 1.2em; /* ~19px reduced to ~17px */
    margin-bottom: 1.2em;
}

h6 { 
    font-size: 1.05em; /* ~16px reduced to ~15px */
    margin-bottom: 1.2em;
}

p {
    font-size: 1.05em; /* ~20px reduced to ~17px */
    margin-bottom: 1.5em;
    line-height: 1.7;
}

/* Modern Content Sections */
.container {
    max-width: 1200px;
    padding: 0 20px;
}

section {
    padding: 40px 0;
    position: relative;
    margin: 20px 0;
    transition: all 0.3s ease;
}

/* Clean content areas without background styling */
.content-section,
.main-content,
.page-content,
div[class="content"],
div[class="section"] {
    padding: 80px 30px;
    margin: 25px 0;
    position: relative;
}

/* Modern Card Styling */
.card, .panel, .well {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .panel:hover, .well:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Modern Button Styling */
.btn {
    font-size: 1.05em; /* ~17px reduced from ~18px */
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    color: white !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color)) !important;
    color: white !important;
}

/* Modern List Styling */
ul, ol {
    font-size: 1.05em; /* ~17px reduced from ~18px */
    line-height: 1.8;
    margin-bottom: 1.5em;
}

li {
    margin-bottom: 0.5em;
    padding-left: 5px;
}

/* Modern Link Styling */
a {
    color: #3b3b3b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: #0c4d96;
    text-decoration: none;
}

a:not(.btn):not(.navbar-brand):not(.navbar-nav a)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #3b3b3b, #0c4d96);
    transition: width 0.3s ease;
}

a:not(.btn):not(.navbar-brand):not(.navbar-nav a):hover::after {
    width: 100%;
}

/* Modern Form Styling */
.form-control {
    font-size: 1.05em; /* ~17px reduced from ~18px */
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid rgba(59, 59, 59, 0.1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: #0c4d96;
    box-shadow: 0 4px 20px rgba(12, 77, 150, 0.2);
    transform: translateY(-1px);
}

.form-group label {
    font-size: 1.05em; /* ~17px reduced from ~18px */
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* Modern Table Styling */
.table {
    font-size: 1.02em; /* ~16px reduced from ~17px */
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.table th {
    font-size: 1.05em; /* ~17px reduced from ~18px */
    font-weight: 600;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: none;
    padding: 18px 15px;
}

.table td {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Modern Alert Styling */
.alert {
    font-size: 1.05em; /* ~17px reduced from ~18px */
    border-radius: 12px;
    border: none;
    padding: 20px 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Enhanced Spacing */
.mb10 { margin-bottom: 15px !important; }
.mt10 { margin-top: 15px !important; }
.mb20 { margin-bottom: 30px !important; }
.mt20 { margin-top: 30px !important; }

/* Modern Responsive Typography */
@media (max-width: 768px) {
    body { font-size: 15px; }
    h1 { font-size: 2.3em; }
    h2 { font-size: 2.0em; }
    h3 { font-size: 1.7em; }
    h4 { font-size: 1.4em; }
    p { font-size: 1.02em; }
    
    .card, .panel, .well {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    section {
        padding: 60px 0;
        margin: 15px 0;
    }
    
    .content-section,
    .main-content,
    .page-content,
    div[class="content"],
    div[class="section"] {
        padding: 30px 20px;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    h1 { font-size: 2.0em; }
    h2 { font-size: 1.8em; }
    h3 { font-size: 1.5em; }
    
    .card, .panel, .well {
        padding: 15px;
    }
    
    section {
        padding: 40px 0;
        margin: 10px 0;
    }
    
    .content-section,
    .main-content,
    .page-content,
    div[class="content"],
    div[class="section"] {
        padding: 25px 15px;
        margin: 15px 0;
    }
}

/* Enhance dropdown transitions */
.navbar-fixed-top .dropdown-menu {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    border: none;
    box-shadow: 0 5px 25px rgba(59, 59, 59, 0.1);
    border-radius: 8px;
}

.navbar-fixed-top .dropdown:hover .dropdown-menu,
.navbar-fixed-top .dropdown.open .dropdown-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.navbar-fixed-top .dropdown-menu > li > a {
    transition: all 0.2s ease;
    padding: 12px 20px;
}

.navbar-fixed-top .dropdown-menu > li > a:hover {
    background-color: rgba(59, 59, 59, 0.05);
    transform: translateX(5px);
    color: #3b3b3b !important;
}

nav:not(.navbar-fixed-top),
header,
footer,
.modal {
    position: relative;
    z-index: 1000;
}

.container,
.container-fluid {
    position: relative;
    z-index: 10;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .shape,
    .orb,
    .wave,
    .mesh-gradient {
        animation-duration: 50s;
        animation-timing-function: linear;
    }
    
    .animated-bg {
        background: #f5f8fa;
    }
}
