:root {
    --primary-color: #2469f3;
    --secondary-color: #8a2be2;
    --gradient-start: #4f46e5;
    --gradient-end: #ec4899;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f97316;
    --error-color: #ef4444;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Enhanced Text Gradient */
.cyber-gradient-text {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end), var(--accent-color), var(--gradient-start));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Enhanced Buttons */
.btn-primary {
    @apply bg-[var(--primary-color)] text-white hover:bg-opacity-90 transition-all duration-300;
    position: relative;
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(36, 105, 243, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(36, 105, 243, 0.4);
}

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

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    @apply bg-slate-100 text-slate-800 hover:bg-slate-200 transition-all duration-300;
    position: relative;
    transform: translateY(0);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced Section Animations */
.section-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-fade-in.animate {
    opacity: 1;
    transform: translateY(0);
}

.section-fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-fade-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.section-fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-fade-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Enhanced Cards */
.card-pop {
    @apply transition-all duration-500 ease-out;
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.card-pop:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card-pop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-pop:hover::before {
    opacity: 1;
}

/* Enhanced Header and Mobile Menu Styles */
.header-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.3s ease;
}

.header-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    @apply text-slate-700 hover:text-[var(--primary-color)] transition-all duration-300 font-medium;
    position: relative;
    padding: 0.5rem 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
}

.dropdown-menu a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    @apply bg-transparent border-none p-2 rounded-lg hover:bg-slate-100 transition-all duration-300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn .material-icons {
    font-size: 1.5rem;
    color: #374151;
}

/* Mobile Menu Container */
.mobile-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.mobile-menu-container.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu */
.mobile-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mobile-menu-container.show .mobile-menu {
    transform: translateX(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.5);
}

.mobile-menu-close {
    @apply bg-transparent border-none p-2 rounded-lg hover:bg-slate-100 transition-all duration-300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close .material-icons {
    font-size: 1.5rem;
    color: #374151;
}

/* Mobile Navigation */
.mobile-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.mobile-nav-link {
    @apply block w-full text-left px-4 py-3 text-slate-700 hover:bg-slate-50 transition-all duration-300;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.mobile-nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

/* Mobile Dropdown */
.mobile-dropdown {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.mobile-dropdown-toggle {
    @apply w-full text-left px-4 py-3 text-slate-700 hover:bg-slate-50 transition-all duration-300;
    background: none;
    border: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.mobile-dropdown-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.mobile-dropdown-content {
    background: rgba(248, 250, 252, 0.5);
    max-height: 0;
    transition: max-height 0.3s ease;
    overflow: hidden;
    border-left: 2px solid rgba(59, 130, 246, 0.1);
    margin-left: 1rem;
}

.mobile-dropdown-content.show {
    max-height: 300px;
    padding: 0.5rem 0;
}

.mobile-dropdown-content a {
    @apply block px-6 py-2 text-sm text-slate-600 hover:bg-slate-100 transition-all duration-300;
    text-decoration: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
    margin: 0.25rem 0;
    border-radius: 0.375rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.mobile-dropdown-content a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.mobile-dropdown .material-icons {
    transition: transform 0.3s ease;
}

.mobile-dropdown.active .material-icons {
    transform: rotate(180deg);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-link {
    @apply px-3 py-2 text-sm font-medium text-slate-600 hover:text-[var(--primary-color)] transition-all duration-300;
    text-decoration: none;
    border-radius: 0.375rem;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.social-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .desktop-nav {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-container {
        padding: 0.5rem 1rem;
    }
    
    .mobile-menu {
        max-width: 100%;
        width: 100%;
    }
    
    .social-links {
        display: none;
    }
    
    .mobile-menu-container {
        width: 100vw;
        height: 100vh;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem;
    }
    
    .mobile-menu-header {
        padding: 0.75rem;
    }
    
    .mobile-nav-link,
    .mobile-dropdown-toggle {
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu {
        max-width: 100%;
        width: 100%;
    }
    
    .mobile-dropdown-content a {
        padding: 0.75rem 1rem 0.75rem 2rem;
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
    
    .mobile-dropdown-content {
        margin-left: 0.5rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-menu {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .mobile-nav-link {
        padding: 0.5rem 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header-glass {
        border-bottom: 0.5px solid rgba(148, 163, 184, 0.1);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mobile-menu {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .mobile-nav-link {
        color: #d1d5db;
        border-bottom-color: rgba(75, 85, 99, 0.3);
    }
    
    .mobile-nav-link:hover {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
    }
    
    .mobile-menu-header {
        background: rgba(31, 41, 55, 0.5);
        border-bottom-color: rgba(75, 85, 99, 0.3);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu,
    .mobile-menu-container,
    .dropdown-menu,
    .nav-link::after {
        transition: none;
    }
}

/* Focus States */
.nav-link:focus,
.mobile-nav-link:focus,
.mobile-dropdown-toggle:focus,
.mobile-menu-btn:focus,
.mobile-menu-close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover::after {
        width: 0;
    }
    
    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
    }
    
    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile touch optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    .btn-primary, .btn-secondary, .nav-link, .mobile-nav-link {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Enhanced Hero Section */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    z-index: 1;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    z-index: -1;
}

/* Enhanced Form Styles */
.form-input {
    @apply w-full px-4 py-3 border border-slate-300 rounded-lg transition-all duration-300;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(36, 105, 243, 0.1);
    transform: translateY(-1px);
}

/* Enhanced Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), var(--gradient-end));
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--gradient-end), var(--primary-color));
}

/* Enhanced Smooth Hover */
.smooth-hover {
    @apply transition-all duration-300 ease-out;
}

/* Enhanced Text Animations */
.text-reveal {
    position: relative;
    z-index: 1;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.text-reveal.animate::after {
    transform: translateX(100%);
}

/* Enhanced Image Hover Effects */
.image-hover {
    transition: all 0.3s ease;
    filter: brightness(1);
    position: relative;
    z-index: 1;
}

.image-hover:hover {
    filter: brightness(1.1) contrast(1.1);
    transform: scale(1.05);
}

/* Enhanced Badge Animations */
.badge-pulse {
    animation: pulse 2s infinite;
}

.badge-float {
    /* Removed float animation to fix background movement */
    /* animation: float 3s ease-in-out infinite; */
    transition: all 0.3s ease;
}

.badge-float:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Enhanced Counter Animation */
.counter-animation {
    transition: all 0.3s ease;
}

.counter-animation:hover {
    transform: scale(1.1);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Domain Filter Buttons */
.filter-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
    border-color: currentColor;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Domain Cards Animation */
.domain-card {
    transition: all 0.3s ease;
}

.domain-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Enhanced Grid Animations */
.grid-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    position: relative;
    z-index: 1;
}

.grid-item.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Focus States */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Enhanced Print Styles */
@media print {
    .card-pop:hover,
    .btn-primary:hover,
    .nav-link:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(45deg, var(--primary-color), var(--gradient-end));
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Ensure proper stacking context for main content */
main {
    position: relative;
    z-index: 1;
}

/* Ensure sections don't interfere with header */
section {
    position: relative;
    z-index: 1;
}

/* Ensure buttons stay above content */
.btn-primary, .btn-secondary {
    position: relative;
    z-index: 1;
}

/* Ensure form elements stay above background */
form {
    position: relative;
    z-index: 1;
}

/* Ensure footer doesn't interfere with header */
footer {
    position: relative;
    z-index: 1;
    @apply transition-all duration-300;
}

/* Application Modal Styles */
#application-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#application-modal > div {
    animation: modalSlideIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#application-modal iframe {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#close-modal {
    transition: all 0.2s ease;
}

#close-modal:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: scale(1.1);
}

/* Modal responsive adjustments */
@media (max-width: 768px) {
    #application-modal > div {
        margin: 1rem;
        max-height: 95vh;
    }
    
    #application-modal iframe {
        height: 500px;
    }
}

@media (max-width: 480px) {
    #application-modal iframe {
        height: 400px;
    }
} 

/* Scroll Lock for Mobile Menu */
body.mobile-menu-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
    height: 100vh;
}

/* Enhanced Scroll Behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed header */
}

body {
    overflow-x: hidden; /* Prevent horizontal scroll */
    scroll-behavior: smooth;
}

/* Prevent scroll issues on mobile */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Ensure proper scroll restoration */
* {
    box-sizing: border-box;
}

/* Prevent scroll issues with fixed elements */
.header-container,
.mobile-menu-container,
.reading-progress {
    will-change: transform;
    backface-visibility: hidden;
}

/* Smooth transitions for scroll-based animations */
.section-fade-in,
.section-fade-in-left,
.section-fade-in-right,
.grid-item {
    will-change: opacity, transform;
}
