/**
 * FinoAi Admin Dashboard - Custom Styles
 * Separated from HTML for better performance and SEO
 */

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid #00BFFF;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Typography - Style Guide Compliance */
h1 {
    font-size: 48px;
    line-height: 1.2;
}

h2 {
    font-size: 36px;
    line-height: 1.3;
}

h3 {
    font-size: 24px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 20px;
    }
}

/* Container Max Width */
.container-custom {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Section Spacing */
.section-spacing {
    padding-top: 80px;
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .section-spacing {
        padding-top: 40px;
        padding-bottom: 40px;
    }
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Card Hover Effects */
.card-hover {
    transition: all 200ms ease;
}

.card-hover:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

/* Loading Animation */
.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Transition Utilities */
.transition-fast {
    transition-duration: 200ms;
}

.transition-base {
    transition-duration: 300ms;
}

.transition-slow {
    transition-duration: 400ms;
}

/* Sidebar styles */
.sidebar {
    transition: transform 0.3s ease-in-out;
}

.sidebar-hidden {
    transform: translateX(-100%);
}

@media (min-width: 1024px) {
    .sidebar-hidden {
        transform: translateX(0);
    }
}

/* Navigation item hover effect */
.nav-item {
    position: relative;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(0, 191, 255, 0.1);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(0, 191, 255, 0.15);
    border-left: 3px solid #00BFFF;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #00BFFF;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

/* Animated gradient text */
.animated-gradient-text {
    background-image: linear-gradient(to right, #40ffaa, #4079ff, #40ffaa, #4079ff, #40ffaa);
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradient-animation 8s linear infinite;
    font-weight: 700;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main content area */
.main-content {
    min-height: calc(100vh - 80px);
}

/* Collapsed sidebar styles */
.sidebar.w-16 .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.w-16 .nav-item:hover {
    transform: translateX(0);
}

/* Hide logo text when collapsed */
.sidebar.w-16 .sidebar-logo-text {
    display: none;
}

/* Tooltip for collapsed sidebar */
.sidebar.w-16 .nav-item {
    position: relative;
}

.sidebar.w-16 .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.sidebar.w-16 .nav-item:hover::after {
    opacity: 1;
}

/* Toggle button inside sidebar */
#sidebar-toggle svg {
    transition: transform 0.3s ease;
}

/* Rotate arrow when collapsed */
.sidebar.w-16 #sidebar-toggle svg {
    transform: rotate(180deg);
}

/* Center toggle button when collapsed */
.sidebar.w-16 > div:first-child {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* Sidebar fixed positioning */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hide scrollbar but keep functionality */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(139, 148, 158, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 148, 158, 0.5);
}

/* Tab Navigation Styles - CSS Radio Button Hack */

/* Hide radio buttons */
input[type="radio"][name="tabs"] {
    display: none;
}

/* Hide all tab content by default */
.tab-content {
    display: none;
}

/* Show content when corresponding radio is checked */
#radio-users:checked ~ .main-content #users,
#radio-goals:checked ~ .main-content #goals,
#radio-financial:checked ~ .main-content #financial,
#radio-health:checked ~ .main-content #health,
#radio-reports:checked ~ .main-content #reports,
#radio-security:checked ~ .main-content #security {
    display: block;
}

/* Navigation link base styles */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(0, 191, 255, 0.1);
    transform: translateX(4px);
}

/* Active state when radio is checked */
#radio-users:checked ~ .sidebar-nav label[for="radio-users"],
#radio-goals:checked ~ .sidebar-nav label[for="radio-goals"],
#radio-financial:checked ~ .sidebar-nav label[for="radio-financial"],
#radio-health:checked ~ .sidebar-nav label[for="radio-health"],
#radio-reports:checked ~ .sidebar-nav label[for="radio-reports"],
#radio-security:checked ~ .sidebar-nav label[for="radio-security"] {
    background: rgba(0, 191, 255, 0.15);
    border-left: 3px solid #00BFFF;
    color: white;
}
