/* Global background gradient */
body, html {
    background: linear-gradient(196deg, #000915 21.08%, #0F294D 61.16%, #030B17 100%);
    background-attachment: fixed;
    color: #FFFFFF;
    min-height: 100vh;
    /* Mobile performance improvements */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Mobile background optimization */
@media (max-width: 959px) {
    body, html {
        background-attachment: scroll; /* Better mobile performance */
    }
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Navigation Styles */
.nav-button {
    text-transform: none !important;
    font-weight: 500 !important;
    border-radius: 20px !important;
    padding: 8px 16px !important;
    margin: 0 2px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Mobile navigation button adjustments */
@media (max-width: 959px) {
    .nav-button {
        border-radius: 16px !important;
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        min-height: 40px !important;
    }
}

.nav-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(34, 164, 93, 0.3) !important;
}

/* Mobile hover adjustments */
@media (hover: none) {
    .nav-button:hover {
        transform: none !important;
    }
    
    .nav-button:active {
        transform: scale(0.98) !important;
    }
}

.nav-button.active {
    background: linear-gradient(135deg, #212a39, #2BC770) !important;
    color: black !important;
    box-shadow: 0 6px 20px rgba(34, 164, 93, 0.4) !important;
}

.nav-button:not(.active) {
    color: rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px) !important;
}

.nav-button:not(.active):hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Active indicator animation */
.nav-button.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #212a39, #2BC770);
    opacity: 0;
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* CTA Button Styles */
.cta-button {
    transition: all 0.3s ease !important;
    min-height: 44px !important; /* Apple's recommended touch target */
}

.cta-button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.5) !important;
}

/* Mobile CTA button adjustments */
@media (hover: none) {
    .cta-button:hover {
        transform: none !important;
    }
    
    .cta-button:active {
        transform: scale(0.98) !important;
    }
}

.cta-button:active {
    transform: translateY(-0px) !important;
}

/* Mobile Menu Styles */
.mobile-nav-menu .mud-menu-item {
    padding: 12px 20px !important;
    transition: all 0.2s ease !important;
    min-height: 48px !important; /* Touch-friendly height */
}

.mobile-nav-menu .mud-menu-item:hover {
    background: rgba(34, 164, 93, 0.1) !important;
}

.active-menu-item {
    background: rgba(34, 164, 93, 0.2) !important;
    color: #22A45D !important;
    font-weight: 600 !important;
}

/* Navbar scroll effects */
.navbar-scrolled {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(25px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Mobile navbar scroll effects */
@media (max-width: 959px) {
    .navbar-scrolled {
        backdrop-filter: blur(15px) !important; /* Reduced blur for mobile performance */
    }
}

/* Section scroll margin for proper positioning */
section[id] {
    scroll-margin-top: 80px;
}

/* Mobile section scroll margin */
@media (max-width: 959px) {
    section[id] {
        scroll-margin-top: 70px;
    }
}

.hero {
    background: radial-gradient(1200px 600px at 10% -10%, rgba(34,164,93,.15), transparent 60%);
}

/* Mobile hero adjustments */
@media (max-width: 959px) {
    .hero {
        background: radial-gradient(800px 400px at 10% -10%, rgba(34,164,93,.15), transparent 60%);
    }
}

/* Dark theme adjustments for MudBlazor components */
.mud-theme-dark {
    background: transparent !important;
}

/* Ensure all sections have transparent backgrounds to show the gradient */
section {
    background: transparent;
}

/* Adjust card backgrounds for visibility on dark background */
.mud-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px !important; /* More mobile-friendly rounded corners */
}

/* Mobile card adjustments */
@media (max-width: 959px) {
    .mud-card {
        backdrop-filter: blur(5px) !important; /* Reduced for mobile performance */
        margin-bottom: 16px !important;
    }
}

.mud-paper {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px !important;
}

/* Mobile paper adjustments */
@media (max-width: 959px) {
    .mud-paper {
        backdrop-filter: blur(5px) !important;
        border-radius: 12px !important;
    }
}

/* Text colors for better contrast */
.mud-typography {
    color: #FFFFFF !important;
}

.mud-typography-caption {
    color: rgba(255, 255, 255, 0.7) !important;
}

.mud-typography-body2 {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Form elements styling */
.mud-input-root {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
}

/* Mobile form improvements */
@media (max-width: 959px) {
    .mud-input-root {
        min-height: 44px !important; /* Touch-friendly input height */
    }
    
    .mud-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

.mud-input {
    color: #FFFFFF !important;
}

.mud-input-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.mud-select {
    color: #FFFFFF !important;
}

/* Mobile select improvements */
@media (max-width: 959px) {
    .mud-select {
        min-height: 44px !important;
    }
}

/* Expansion panels */
.mud-expand-panel {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px !important;
    margin-bottom: 12px !important;
}

/* Mobile expansion panel adjustments */
@media (max-width: 959px) {
    .mud-expand-panel {
        border-radius: 12px !important;
    }
    
    .mud-expand-panel .mud-expand-panel-header {
        padding: 16px !important;
        min-height: 56px !important;
    }
}

/* Tabs */
.mud-tabs {
    background: transparent !important;
}

.mud-tab {
    color: rgba(255, 255, 255, 0.7) !important;
    min-height: 48px !important; /* Touch-friendly tab height */
}

.mud-tab.mud-tab-active {
    color: #22A45D !important;
}

/* Mobile tab adjustments */
@media (max-width: 959px) {
    .mud-tab {
        padding: 12px 16px !important;
        font-size: 0.9rem !important;
    }
}

/* Alerts */
.mud-alert-filled-info {
    background: rgba(47, 128, 237, 0.2) !important;
    border: 1px solid rgba(47, 128, 237, 0.4);
    border-radius: 12px !important;
}

.mud-alert-filled-success {
    background: rgba(34, 164, 93, 0.2) !important;
    border: 1px solid rgba(34, 164, 93, 0.4);
    border-radius: 12px !important;
}

.mud-alert-filled-error {
    background: rgba(244, 67, 54, 0.2) !important;
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 12px !important;
}

/* List items */
.mud-list-item {
    color: rgba(255, 255, 255, 0.9) !important;
    min-height: 48px !important; /* Touch-friendly list items */
}

/* Mobile list item adjustments */
@media (max-width: 959px) {
    .mud-list-item {
        padding: 12px 16px !important;
    }
}

/* Stepper */
.mud-stepper {
    background: transparent !important;
}

.mud-step {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
}

/* Footer */
.mud-footer {
    background: rgba(0, 0, 0, 0.3) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Links */
.mud-link {
    color: #22A45D !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.mud-link:hover {
    color: #2BC770 !important;
}

/* Mobile link improvements */
@media (max-width: 959px) {
    .mud-link {
        min-height: 44px !important; /* Touch-friendly links */
        display: inline-flex !important;
        align-items: center !important;
    }
}

/* Chips */
.mud-chip-filled {
    border: 1px solid rgba(34, 164, 93, 0.3);
    border-radius: 20px !important;
}

/* Mobile chip adjustments */
@media (max-width: 959px) {
    .mud-chip-filled {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 16px !important;
    }
}

/* Utility classes with mobile responsiveness */
.py-16 { 
    padding-top: 4rem; 
    padding-bottom: 4rem; 
}

.py-12 { 
    padding-top: 3rem; 
    padding-bottom: 3rem; 
}

.py-10 { 
    padding-top: 2.5rem; 
    padding-bottom: 2.5rem; 
}

/* Mobile utility adjustments */
@media (max-width: 959px) {
    .py-16 { 
        padding-top: 2.5rem !important; 
        padding-bottom: 2.5rem !important; 
    }
    
    .py-12 { 
        padding-top: 2rem !important; 
        padding-bottom: 2rem !important; 
    }
    
    .py-10 { 
        padding-top: 1.5rem !important; 
        padding-bottom: 1.5rem !important; 
    }
}

/* Scrollbar styling for better mobile experience */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 164, 93, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 164, 93, 0.7);
}

/* Mobile scrollbar - thinner */
@media (max-width: 959px) {
    ::-webkit-scrollbar {
        width: 4px;
    }
}

/* Performance optimizations */
@media (max-width: 959px) {
    /* Reduce animation complexity on mobile */
    * {
        will-change: auto !important;
    }
    
    /* Optimize transforms for mobile */
    .mud-button,
    .mud-card,
    .nav-button {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Safe area support for devices with notches */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Prevent horizontal scrolling */
body, html {
    overflow-x: hidden;
    width: 100%;
}

/* High DPI mobile display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .mud-typography {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}
