/* Wetter-Alarm Monitoring Dashboard - Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== GLOBAL STYLES ===== */
body {
    font-family: 'Inter', sans-serif;
}

/* ===== GRADIENTS AND BACKGROUNDS ===== */
.gradient-bg {
    background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
}

.status-online {
    background: linear-gradient(87deg, #2dce89 0, #2dcecc 100%);
}

.status-warning {
    background: linear-gradient(87deg, #fb6340 0, #fbb140 100%);
}

.status-error {
    background: linear-gradient(87deg, #f5365c 0, #f56036 100%);
}

/* ===== SHADOWS AND CARDS ===== */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-lg {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== LAYOUT AND NAVIGATION ===== */
.sidebar-transition {
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .sidebar-hidden {
        transform: translateX(-100%);
    }
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
    border: none;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ===== FORM ELEMENTS ===== */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: #374151;
}

.form-input:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #ffffff;
    color: #374151;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.form-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* ===== DARK MODE STYLES ===== */
.dark {
    background-color: #1a202c !important;
    color: #e2e8f0 !important;
}

/* Background Colors */
.dark .bg-white {
    background-color: #2d3748 !important;
}

.dark .bg-gray-50 {
    background-color: #1a202c !important;
}

.dark .bg-gray-100 {
    background-color: #2d3748 !important;
}

/* Text Colors */
.dark .text-gray-900 {
    color: #e2e8f0 !important;
}

.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

.dark .text-gray-700 {
    color: #cbd5e0 !important;
}

.dark .text-gray-600 {
    color: #a0aec0 !important;
}

.dark .text-gray-500 {
    color: #718096 !important;
}

.dark .text-gray-400 {
    color: #a0aec0 !important;
}

/* Border Colors */
.dark .border-gray-200 {
    border-color: #4a5568 !important;
}

.dark .border-gray-300 {
    border-color: #4a5568 !important;
}

/* Card Shadows in Dark Mode */
.dark .card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15) !important;
}

.dark .card-shadow-lg {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.15) !important;
}

/* Navigation & Sidebar in Dark Mode */
.dark nav {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
}

.dark header {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
}

/* Tables in Dark Mode */
.dark table {
    background-color: #2d3748 !important;
}

.dark thead {
    background-color: #374151 !important;
}

.dark tbody tr {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
}

.dark tbody tr:nth-child(even) {
    background-color: #374151 !important;
}

/* Buttons in Dark Mode */
.dark .btn {
    border-color: #4a5568 !important;
}

/* Status indicators in Dark Mode */
.dark .bg-blue-100 {
    background-color: #2c5282 !important;
}

.dark .bg-green-100 {
    background-color: #2d5a3d !important;
}

.dark .bg-yellow-100 {
    background-color: #744210 !important;
}

.dark .bg-red-100 {
    background-color: #742a2a !important;
}

.dark .text-blue-800 {
    color: #bee3f8 !important;
}

.dark .text-green-800 {
    color: #c6f6d5 !important;
}

.dark .text-yellow-800 {
    color: #faf089 !important;
}

.dark .text-red-800 {
    color: #fed7d7 !important;
}

/* Dividers in Dark Mode */
.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #4a5568 !important;
}

/* Hover effects in Dark Mode */
.dark .hover\:bg-gray-50:hover {
    background-color: #374151 !important;
}

.dark .hover\:bg-gray-100:hover {
    background-color: #4a5568 !important;
}

/* Form elements in Dark Mode */
.dark select {
    background-color: #4a5568 !important;
    border-color: #718096 !important;
    color: #e2e8f0 !important;
}

.dark select:focus {
    border-color: #5e72e4 !important;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2) !important;
}

.dark option {
    background-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

.dark .form-input {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.dark .form-input:focus {
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}

.dark .form-select {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.dark .form-select:focus {
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}

.dark .form-textarea {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.dark .form-textarea:focus {
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}

.dark .form-label {
    color: #f9fafb !important;
}

/* Placeholder text in Dark Mode */
.dark .form-input::placeholder {
    color: #9ca3af;
}

.dark .form-textarea::placeholder {
    color: #9ca3af;
}

/* Option text in Dark Mode */
.dark .form-select option {
    background-color: #4a5568;
    color: #e2e8f0;
}

/* ===== THEME TOGGLE SWITCH ===== */
.theme-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.theme-toggle input:checked + .theme-toggle-slider {
    background-color: #5e72e4;
}

.theme-toggle input:checked + .theme-toggle-slider:before {
    transform: translateX(26px);
}

/* ===== NOTIFICATION STYLES ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
}

.notification.success {
    background-color: #f0f9ff;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.notification.error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.notification.warning {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.dark .notification.success {
    background-color: #1a2e05;
    color: #86efac;
}

.dark .notification.error {
    background-color: #2d0a0a;
    color: #fca5a5;
}

.dark .notification.warning {
    background-color: #2d1b05;
    color: #fcd34d;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5e72e4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== RESPONSIVE UTILITIES ===== */

/* Mobile Navigation */
@media (max-width: 1024px) {
    .mobile-nav-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        transition: opacity 0.3s ease-in-out;
    }

    .mobile-nav-overlay.hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* Improved sidebar animations */
    nav.sidebar-mobile {
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .dark nav.sidebar-mobile {
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
}

/* Touch-friendly buttons */
@media (max-width: 768px) {
    button, a.cursor-pointer {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-primary, .btn {
        padding: 0.875rem 1.25rem;
        font-size: 16px;
    }

    /* Improve touch feedback */
    button:active, a.cursor-pointer:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    /* Larger touch targets for icon buttons */
    nav button, header button {
        padding: 0.75rem;
    }

    /* Better spacing for mobile navigation items */
    nav a {
        padding: 1rem 0.75rem !important;
        font-size: 1rem;
    }
}

/* Mobile Tables - Card Layout */
@media (max-width: 768px) {
    .mobile-table-card {
        display: block;
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
        background-color: white;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }

    .dark .mobile-table-card {
        background-color: #2d3748;
    }

    .mobile-table-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .dark .mobile-table-row {
        border-bottom-color: #4a5568;
    }

    .mobile-table-row:last-child {
        border-bottom: none;
    }

    .mobile-table-label {
        font-weight: 600;
        color: #6b7280;
        font-size: 0.875rem;
    }

    .dark .mobile-table-label {
        color: #9ca3af;
    }

    .mobile-table-value {
        color: #111827;
        font-size: 0.875rem;
        text-align: right;
    }

    .dark .mobile-table-value {
        color: #f9fafb;
    }
}

/* Hide table headers on mobile */
@media (max-width: 768px) {
    .mobile-hide-table thead {
        display: none;
    }

    .mobile-hide-table tbody {
        display: block;
    }

    .mobile-hide-table tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 1rem;
        background-color: white;
    }

    .dark .mobile-hide-table tr {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .mobile-hide-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
    }

    .mobile-hide-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        margin-right: 1rem;
    }

    .dark .mobile-hide-table td:before {
        color: #9ca3af;
    }
}

/* Mobile Modals - Full Screen */
@media (max-width: 640px) {
    .mobile-modal {
        position: fixed !important;
        inset: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    .mobile-modal-content {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Chart containers on mobile */
@media (max-width: 768px) {
    .chart-container {
        height: 250px !important;
        min-height: 250px;
    }

    canvas {
        max-height: 250px;
    }
}

/* Stats Cards stacking */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

/* API Cards on mobile */
@media (max-width: 768px) {
    .api-card {
        padding: 1rem;
    }

    .api-card-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .api-card-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Form inputs on mobile */
@media (max-width: 640px) {
    .form-grid-mobile {
        grid-template-columns: 1fr !important;
    }

    .form-input, .form-select, .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Alert cards on mobile */
@media (max-width: 768px) {
    .alert-card {
        padding: 0.75rem;
    }

    .alert-card .text-sm {
        font-size: 0.813rem;
    }
}

/* Sidebar adjustments */
@media (max-width: 1024px) {
    .sidebar-mobile {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar-mobile.open {
        transform: translateX(0);
    }
}

/* Header spacing on mobile */
@media (max-width: 640px) {
    header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    main {
        padding: 1rem;
    }

    /* Better header layout on mobile */
    header h2 {
        font-size: 1.125rem;
        line-height: 1.5rem;
    }

    /* Stack header elements on very small screens */
    header .flex.items-center.space-x-4 {
        gap: 0.5rem;
    }

    /* Improve dropdown/select sizing */
    header select {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Notification positioning on mobile */
@media (max-width: 640px) {
    .notification {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: calc(100vw - 20px);
    }
}

/* Loading overlay text */
@media (max-width: 640px) {
    .loading-overlay p {
        font-size: 0.875rem;
    }
}

/* Base responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-full-width {
        width: 100%;
    }

    .mobile-text-sm {
        font-size: 0.875rem;
    }

    .mobile-text-xs {
        font-size: 0.75rem;
    }

    .mobile-stack {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-p-4 {
        padding: 1rem;
    }

    .mobile-py-2 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    .sidebar-mobile {
        width: 200px;
    }

    header {
        height: 48px;
    }

    .chart-container {
        height: 180px !important;
    }

    /* Compact navigation items in landscape */
    nav a {
        padding: 0.625rem 0.75rem !important;
        font-size: 0.875rem;
    }

    /* Reduce padding for better space usage */
    main {
        padding: 0.75rem;
    }
}

/* ===== SWIPE GESTURES & MOBILE INTERACTIONS ===== */
@media (max-width: 1024px) {
    /* Smooth transitions for swipe-able elements */
    .swipe-container {
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Pull-to-refresh indicator */
    .pull-to-refresh {
        position: absolute;
        top: -60px;
        left: 50%;
        transform: translateX(-50%);
        transition: top 0.3s ease;
    }

    .pull-to-refresh.active {
        top: 20px;
    }
}

/* ===== IMPROVED MOBILE CARD LAYOUTS ===== */
@media (max-width: 768px) {
    /* Optimize card spacing */
    .card-shadow {
        margin-bottom: 0.75rem;
    }

    /* Better card padding on mobile */
    .bg-white.rounded-xl.card-shadow {
        padding: 1rem !important;
    }

    /* Compact stat cards */
    .stats-grid > div {
        padding: 1rem !important;
    }

    .stats-grid h3 {
        font-size: 1rem;
    }

    .stats-grid p.text-2xl {
        font-size: 1.5rem !important;
    }

    /* Improve icon sizes in mobile cards */
    .stats-grid .w-12.h-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    .stats-grid .w-12.h-12 i {
        font-size: 1rem !important;
    }
}

/* ===== MOBILE FORM IMPROVEMENTS ===== */
@media (max-width: 640px) {
    /* Prevent zoom on iOS when focusing inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Better form field spacing */
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.875rem 1rem;
    }

    /* Full-width form buttons */
    form button[type="submit"] {
        width: 100%;
    }

    /* Stack form buttons */
    form .flex.space-x-2 {
        flex-direction: column;
        gap: 0.5rem;
    }

    form .flex.space-x-2 > * {
        width: 100%;
    }
}

/* ===== MOBILE SEARCH & FILTERS ===== */
@media (max-width: 768px) {
    /* Search bar optimizations */
    .search-container {
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Filter dropdowns */
    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }
}

/* ===== MOBILE NAVIGATION ENHANCEMENTS ===== */
@media (max-width: 1024px) {
    /* Fixed bottom navigation for mobile (optional) */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        z-index: 30;
        display: flex;
        justify-content: space-around;
        padding: 0.5rem;
    }

    .dark .mobile-bottom-nav {
        background: #2d3748;
        border-top-color: #4a5568;
    }

    .mobile-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
        color: #6b7280;
        text-decoration: none;
        font-size: 0.75rem;
        min-width: 60px;
    }

    .dark .mobile-bottom-nav-item {
        color: #9ca3af;
    }

    .mobile-bottom-nav-item.active {
        color: #5e72e4;
    }

    .mobile-bottom-nav-item i {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .gradient-bg {
        border: 2px solid currentColor;
    }

    .card-shadow {
        border: 1px solid #d1d5db;
    }
}

/* ===== LOGIN PAGE STYLES ===== */
.login-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.dark .login-card {
    background: rgba(45, 55, 72, 0.95);
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #4b5563;
}

.dark .password-toggle:hover {
    color: #d1d5db;
}

/* Login Button Hover Effect */
.login-btn {
    background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
    transition: all 0.3s ease;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(94, 114, 228, 0.3);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Mobile Login Adjustments */
@media (max-width: 640px) {
    .login-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .login-icon {
        width: 56px;
        height: 56px;
    }

    .login-card h2 {
        font-size: 1.5rem;
    }

    .login-card p {
        font-size: 0.875rem;
    }

    /* Ensure login form inputs are properly sized */
    .login-card input {
        font-size: 16px;
        padding: 0.875rem 1rem;
    }

    /* Better spacing for login form elements */
    .login-card form > div {
        margin-bottom: 1rem;
    }

    /* Mobile-optimized login button */
    .login-card button[type="submit"] {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .login-card {
        padding: 1rem;
    }

    .login-card h2 {
        font-size: 1.25rem;
    }

    .login-card input,
    .login-card button {
        font-size: 14px;
    }
}

/* Mobile Menu Animation for Login Page */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

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

/* Improved mobile menu styling */
@media (max-width: 1024px) {
    .mobile-menu {
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    }

    .dark .mobile-menu {
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    }

    /* Mobile menu items */
    .mobile-menu a {
        transition: all 0.2s ease;
    }

    .mobile-menu a:active {
        transform: scale(0.98);
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

.dark ::-webkit-scrollbar-track {
    background: #2d3748;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* ===== SAFE AREA SUPPORT FOR NOTCHED DEVICES ===== */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
    padding-left: env(safe-area-inset-left);
}

.safe-area-right {
    padding-right: env(safe-area-inset-right);
}

/* ===== TOUCH MANIPULATION ===== */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.active\:scale-98:active {
    transform: scale(0.98);
}

/* ===== PREVENT ACCIDENTAL ZOOM ON DOUBLE TAP ===== */
* {
    touch-action: manipulation;
}

/* ===== IMPROVED MOBILE PERFORMANCE ===== */
@media (max-width: 1024px) {
    /* Use GPU acceleration for animations */
    .sidebar-transition,
    .mobile-menu,
    .mobile-nav-overlay {
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Optimize rendering */
    .card-shadow,
    .bg-white,
    .bg-gray-800 {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* ===== MOBILE SPECIFIC UTILITIES ===== */
@media (max-width: 640px) {
    /* Hidden on mobile */
    .mobile-hidden {
        display: none !important;
    }

    /* Full width on mobile */
    .mobile-full {
        width: 100% !important;
    }

    /* Text adjustments */
    .mobile-text-base {
        font-size: 1rem !important;
    }

    .mobile-text-sm {
        font-size: 0.875rem !important;
    }

    /* Padding adjustments */
    .mobile-p-2 {
        padding: 0.5rem !important;
    }

    .mobile-p-4 {
        padding: 1rem !important;
    }

    /* Margin adjustments */
    .mobile-mb-2 {
        margin-bottom: 0.5rem !important;
    }

    .mobile-mb-4 {
        margin-bottom: 1rem !important;
    }
}

/* ===== LANDSCAPE ORIENTATION FIXES ===== */
@media (max-height: 500px) and (orientation: landscape) {
    /* Compact header in landscape */
    header {
        height: 48px !important;
    }

    /* Reduce padding in landscape */
    main {
        padding: 0.75rem !important;
    }

    /* Smaller cards in landscape */
    .stats-grid > div {
        padding: 0.75rem !important;
    }

    /* Compact sidebar */
    nav.sidebar-mobile {
        width: 220px !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide navigation and non-essential elements */
    nav,
    header,
    .mobile-nav-overlay,
    .notification,
    .loading-overlay {
        display: none !important;
    }

    /* Full width for printing */
    .lg\:pl-64 {
        padding-left: 0 !important;
    }

    /* Ensure readable text */
    body {
        background: white !important;
        color: black !important;
    }

    /* Remove shadows for better printing */
    .card-shadow {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}