/* DataZist Custom Styles */

/* Font Optimization */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Custom Colors */
.text-brand {
    color: #3B82F6;
}

.bg-brand {
    background-color: #3B82F6;
}

.btn-primary {
    @apply bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition;
}

.btn-secondary {
    @apply bg-gray-100 text-gray-700 px-4 py-2 rounded-md hover:bg-gray-200 transition;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Card Hover Effects */
.hover-card-lift {
    transition: transform 0.2s ease-in-out;
}

.hover-card-lift:hover {
    transform: translateY(-5px);
}

/* Inputs & Form Elements */
input:focus, textarea:focus, select:focus {
    @apply outline-none ring-2 ring-blue-500 border-blue-500;
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    @apply rounded;
}

/* Loading Spinner Animation */
.loading-spinner {
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focused Navigation Item Style */
.nav-item-active {
    @apply text-blue-600 border-b-2 border-blue-600;
}

/* Custom Button Styles */
.btn-gradient {
    background: linear-gradient(90deg, #3B82F6 0%, #6366F1 100%);
    @apply text-white px-6 py-2 rounded-md font-medium transition-colors;
}

.btn-gradient:hover {
    background: linear-gradient(90deg, #2563EB 0%, #4F46E5 100%);
}

/* Custom Badge Styles */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-blue {
    @apply bg-blue-100 text-blue-800;
}

.badge-green {
    @apply bg-green-100 text-green-800;
}

.badge-yellow {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-red {
    @apply bg-red-100 text-red-800;
}

/* Premium Content Indicator */
.premium-content::before {
    content: "*";
    @apply text-yellow-500 mr-1 font-bold;
}

/* Responsive Table Styles */
@media (max-width: 640px) {
    .responsive-table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    .print-break-inside-avoid {
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-size: 0.875rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Focus Visible for Keyboard Navigation */
:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Header Layout */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem;
    width: 100%;
}

/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 4rem;
    width: auto;
}

@media (max-width: 768px) {
    .logo-img {
        height: 3rem;
    }
}

.logo-container a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 5rem;
    font-weight: 600;
    color: #3B82F6;
    text-decoration: none;
}

/* Hide generated DataZist text next to the logo */
.logo-container a::after {
    content: none !important;
    display: none !important;
}

@media (max-width: 768px) {
    .logo-container img {
        height: 2rem;
    }
    
    .logo-container a {
        font-size: 4rem;
    }
}

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

.desktop-nav a {
    color: #4B5563;
    transition: all 0.2s;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.5rem 0;
    font-weight: 500;
}

.desktop-nav a:hover {
    color: #3B82F6;
}

.desktop-nav a[aria-current="page"] {
    color: #3B82F6;
    border-bottom: 2px solid #3B82F6;
}

/* Login Button */
.login-button {
    background-color: #3B82F6;
    color: white !important;
    padding: 0.625rem 1.75rem !important;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
}

.login-button:hover {
    background-color: #2563EB !important;
    color: white !important;
}

.desktop-nav .login-button {
    margin-left: 1rem;
}

/* Mobile Navigation */
.mobile-nav-group {
    display: none;
}

.mobile-menu-container {
    display: none;
}

.hamburger-button {
    width: 24px;
    height: 24px;
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    display: none;
}

.hamburger-button span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #4B5563;
    position: absolute;
    left: 0;
    transition: all 0.3s;
}

.hamburger-button span:first-child {
    top: 2px;
}

.hamburger-button span:nth-child(2) {
    top: 11px;
}

.hamburger-button span:last-child {
    bottom: 2px;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: white;
    z-index: 50;
    transition: right 0.3s ease-in-out;
    padding: 2rem 1.5rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.mobile-menu.active .mobile-menu-overlay {
    display: block;
}

.mobile-menu.active .mobile-menu-panel {
    right: 0;
}

.mobile-menu.active .hamburger-button span:first-child {
    transform: rotate(45deg);
    top: 11px;
}

.mobile-menu.active .hamburger-button span:nth-child(2) {
    opacity: 0;
}

.mobile-menu.active .hamburger-button span:last-child {
    transform: rotate(-45deg);
    bottom: 11px;
}

.mobile-nav-items {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-items a {
    display: block;
    padding: 0.75rem;
    color: #4B5563;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.mobile-nav-items a:hover {
    color: #3B82F6;
}

.mobile-nav-items a.active {
    color: #3B82F6;
    background-color: #EBF5FF;
    border-radius: 0.375rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-nav {
        padding: 0.75rem 1rem;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-nav-group {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .mobile-menu-container {
        display: block;
    }

    .hamburger-button {
        display: block;
    }

    .logo-container img {
        height: 2.5rem;
    }

    .login-button {
        padding: 0.5rem 1.25rem !important;
        font-size: 0.875rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-container {
        display: none;
    }

    .desktop-nav {
        display: flex;
    }
}

/* Remove conflicting mobile menu styles */
.mobile-menu {
    display: block !important;
}

.mobile-menu-content {
    display: none;
}

/* Logo sizing */
.logo-container img {
    height: 4rem;
    transition: height 0.2s;
}

@media (max-width: 768px) {
    .logo-container img {
        height: 2.5rem;
    }
}

.logo-img {
    height: 4rem;
    width: auto;
}

/* Hide DataZist text next to the logo */
.datazist-text {
    display: none;
}

/* Toggle switch and country pill styles */
.country-checkbox { display: none; }
.country-label {
    display: inline-block;
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    cursor: pointer;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.country-checkbox:checked + .country-label {
    background-color: #3B82F6;
    color: #fff;
}
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    border-radius: 9999px;
    transition: 0.2s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 9999px;
    transition: 0.2s;
}
.switch input:checked + .slider {
    background-color: #3B82F6;
}
.switch input:checked + .slider:before {
    transform: translateX(16px);
}

/* Hide scrollbar for horizontal scroll containers */
.hide-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
} 