/**
 * Main Stylesheet - WhatIsMyIPCity
 * Single source CSS file to avoid conflicts
 * Combines Tailwind components with custom styles
 */

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    border-color: #6b7280;
}

.btn-secondary:hover {
    background-color: #4b5563;
    border-color: #4b5563;
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: #3b82f6;
    border-color: #3b82f6;
}

.btn-outline:hover {
    background-color: #3b82f6;
    color: white;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.card-body {
    color: #6b7280;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }

.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }

.border { border: 1px solid #e5e7eb; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }

.overflow-hidden { overflow: hidden; }

.cursor-pointer { cursor: pointer; }

.transition { transition: all 0.2s ease; }

/* ==========================================================================
   DARK MODE
   ========================================================================== */

.dark {
    color-scheme: dark;
}

.dark body {
    background-color: #111827;
    color: #f9fafb;
}

.dark .card {
    background: #1f2937;
    border-color: #374151;
}

.dark .card-title {
    color: #f9fafb;
}

.dark .card-body {
    color: #d1d5db;
}

.dark .form-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.dark .form-input:focus {
    border-color: #3b82f6;
}

.dark .form-label {
    color: #d1d5db;
}

.dark .text-gray-500 { color: #9ca3af; }
.dark .text-gray-600 { color: #d1d5db; }
.dark .text-gray-700 { color: #e5e7eb; }
.dark .text-gray-900 { color: #f9fafb; }

.dark .bg-gray-50 { background-color: #1f2937; }
.dark .bg-gray-100 { background-color: #374151; }
.dark .bg-gray-200 { background-color: #4b5563; }

.dark .border-gray-200 { border-color: #4b5563; }
.dark .border-gray-300 { border-color: #6b7280; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* ==========================================================================
   BANNER ROTATOR
   ========================================================================== */

.banner-rotator {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    max-width: none;
    position: relative;
}

.banner-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    border-radius: 8px;
    max-width: 100%;
}

/* Text Banner Styles */
.text-banner .banner-container {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

/* Top Content Styles - Break out of containers */
.top-content .banner-rotator {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    text-align: center;
    max-width: none;
    position: relative;
}

/* Sidebar Content Styles */
.sidebar-content .banner-rotator {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    max-width: 300px;
}

.sidebar-content .banner-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.sidebar-content .banner-image {
    width: 100%;
    height: auto;
    max-width: 300px;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    border-radius: 8px;
}

/* Ultrawide Content Styles */
.ultrawide-content .banner-rotator {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    max-width: none;
}

.ultrawide-content .banner-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.ultrawide-content .banner-image {
    width: 100%;
    height: auto;
    max-width: none;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    border-radius: 8px;
}

.text-banner .text-container {
    width: 100%;
    max-width: none;
    border-radius: 8px;
    overflow: hidden;
}

.text-banner .text-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.text-banner .text-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Banner placeholder styles */
.banner-placeholder {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.placeholder-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.placeholder-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0;
}

/* Dark mode banner styles */
.dark .banner-placeholder {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border-color: #6b7280;
}

.dark .placeholder-text {
    color: #d1d5db;
}

.dark .placeholder-subtitle {
    color: #9ca3af;
}

/* ==========================================================================
   ULTRAWIDE CONTENT
   ========================================================================== */

/* Ultrawide content - full width on very wide screens */
.ultrawide-content {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    position: relative;
    left: 50%;
    right: 50%;
    transform: translateX(-50%);
}

/* Ensure ultrawide content doesn't break on smaller screens */
@media (max-width: 1920px) {
    .ultrawide-content {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        left: auto;
        right: auto;
        transform: none;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 640px) {
    .container-content {
        padding: 0 1rem;
    }
    
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .banner-container {
        max-width: 100%;
        margin: 0 1rem;
    }
    
    .top-content .banner-rotator {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Mobile IP Address Display - Ensure at least 70% width */
    .hero-ip-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .hero-ip-title {
        font-size: 1.5rem;
        font-weight: bold;
        color: #111827;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .hero-ip-address {
        width: 80%;
        min-width: 80%;
        font-size: 2rem;
        font-weight: bold;
        color: #3b82f6;
        font-family: 'Courier New', monospace;
        text-align: center;
        word-break: break-all;
        padding: 0.5rem;
        background: #f3f4f6;
        border-radius: 0.5rem;
        border: 2px solid #e5e7eb;
    }
    
    .dark .hero-ip-title {
        color: #f9fafb;
    }
    
    .dark .hero-ip-address {
        color: #60a5fa;
        background: #374151;
        border-color: #4b5563;
    }
}

/* Desktop styles for hero IP elements */
@media (min-width: 641px) {
    .hero-ip-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-ip-title {
        font-size: 3rem;
        font-weight: bold;
        color: #111827;
        white-space: nowrap;
    }
    
    .hero-ip-address {
        width: auto;
        min-width: auto;
        font-size: 3.5rem;
        font-weight: bold;
        color: #3b82f6;
        font-family: 'Courier New', monospace;
        white-space: nowrap;
        background: none;
        border: none;
        padding: 0;
    }
    
    .dark .hero-ip-title {
        color: #f9fafb;
    }
    
    .dark .hero-ip-address {
        color: #60a5fa;
        background: none;
        border: none;
    }
}

@media (max-width: 480px) {
    .container-content {
        padding: 0 0.75rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    /* Extra small screens - ensure IP is still 80% width */
    .hero-ip-address {
        width: 80%;
        min-width: 80%;
        font-size: 1.75rem;
    }
    
    .hero-ip-title {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
.btn:focus,
.form-input:focus,
.banner-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid;
    }
    
    .btn {
        border: 2px solid;
    }
}

/* ==========================================================================
   CUSTOM COMPONENTS
   ========================================================================== */

/* IP Address Display */
.ip-address {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #3b82f6;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.dark .ip-address {
    background: #374151;
    color: #60a5fa;
}

/* Status Indicators */
.status-online {
    color: #10b981;
}

.status-offline {
    color: #ef4444;
}

.status-warning {
    color: #f59e0b;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.break-words {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.select-none {
    user-select: none;
}

.pointer-events-none {
    pointer-events: none;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* ==========================================================================
   TABLE STYLES
   ========================================================================== */

/* Base table styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

/* Table styling */
.table {
    width: 100%;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.table thead {
    background-color: #f9fafb;
}

.table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

/* Alternating row colors - light gray and white with higher specificity */
.table tbody tr:nth-child(even) {
    background-color: #f9fafb !important;
}

.table tbody tr:nth-child(odd) {
    background-color: white !important;
}

.table tbody tr:hover {
    background-color: #f3f4f6 !important;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody td {
    padding: 1rem;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: top;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
}

/* Dark mode table styles */
.dark .table {
    background-color: #1f2937;
}

.dark .table thead {
    background-color: #374151;
}

.dark .table thead th {
    color: #d1d5db;
    border-bottom-color: #4b5563;
}

.dark .table tbody tr {
    border-bottom-color: #4b5563;
}

/* Dark mode alternating row colors with higher specificity */
.dark .table tbody tr:nth-child(even) {
    background-color: #374151 !important;
}

.dark .table tbody tr:nth-child(odd) {
    background-color: #1f2937 !important;
}

.dark .table tbody tr:hover {
    background-color: #4b5563 !important;
}

.dark .table tbody td {
    color: #e5e7eb;
}

/* Mobile table optimizations */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 0.5rem;
        border: 1px solid #e5e7eb;
    }
    
    .dark .table-responsive {
        border-color: #4b5563;
    }
    
    .table thead th {
        padding: 0.5rem 0.75rem;
        font-size: 0.6875rem;
    }
    
    .table tbody td {
        padding: 0.75rem;
        font-size: 0.8125rem;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto;
    }
    
    /* Stack table cells on very small screens */
    .table-stack-mobile {
        display: block;
    }
    
    .table-stack-mobile thead {
        display: none;
    }
    
    .table-stack-mobile tbody,
    .table-stack-mobile tr,
    .table-stack-mobile td {
        display: block;
    }
    
    .table-stack-mobile tr {
        background-color: white;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
    
    .dark .table-stack-mobile tr {
        background-color: #1f2937;
        border-color: #4b5563;
    }
    
    .table-stack-mobile td {
        border: none;
        padding: 0.25rem 0;
        position: relative;
        padding-left: 50%;
    }
    
    .table-stack-mobile td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .dark .table-stack-mobile td:before {
        color: #9ca3af;
    }
}

/* Table cell content optimizations */
.table-cell-nowrap {
    white-space: nowrap;
}

.table-cell-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

.table-cell-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Enhanced text wrapping utilities for tables */
.table-cell-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

.table-cell-nowrap-safe {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Table action buttons */
.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 2rem;
}

.table-action-btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.table-action-btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.table-action-btn-secondary {
    background-color: #6b7280;
    color: white;
    border-color: #6b7280;
}

.table-action-btn-secondary:hover {
    background-color: #4b5563;
    border-color: #4b5563;
    color: white;
}

/* Mobile card styles for table alternatives */
.mobile-card {
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.mobile-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .mobile-card {
    background-color: #1f2937;
    border-color: #4b5563;
}

.mobile-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.mobile-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.dark .mobile-card-title {
    color: #f9fafb;
}

.mobile-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .mobile-card-badge {
    background-color: #1e3a8a;
    color: #dbeafe;
}

.mobile-card-content {
    margin-bottom: 1rem;
}

.mobile-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mobile-card-field {
    display: flex;
    flex-direction: column;
}

.mobile-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dark .mobile-card-label {
    color: #9ca3af;
}

.mobile-card-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.dark .mobile-card-value {
    color: #f9fafb;
}

.mobile-card-actions {
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.dark .mobile-card-actions {
    border-top-color: #4b5563;
}

/* Table pagination mobile optimization */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.table-pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.dark .table-pagination-info {
    color: #9ca3af;
}

.table-pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.table-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 2.5rem;
}

.table-pagination-btn:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.table-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.table-pagination-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.dark .table-pagination-btn {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.dark .table-pagination-btn:hover:not(:disabled) {
    background-color: #4b5563;
    border-color: #6b7280;
}

.dark .table-pagination-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

@media (max-width: 640px) {
    .table-pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-pagination-controls {
        justify-content: center;
    }
    
    .table-pagination-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 3rem;
    }
}

/* Table loading and empty states */
.table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.dark .table-loading {
    color: #9ca3af;
}

.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.dark .table-empty {
    color: #9ca3af;
}

.table-empty-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #d1d5db;
}

.dark .table-empty-icon {
    color: #4b5563;
}

/* Table export buttons mobile optimization */
.table-export-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.table-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 3rem;
}

.table-export-btn-csv {
    background-color: #059669;
    color: white;
    border-color: #059669;
}

.table-export-btn-csv:hover {
    background-color: #047857;
    border-color: #047857;
    color: white;
}

.table-export-btn-json {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

.table-export-btn-json:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: white;
}

@media (max-width: 640px) {
    .table-export-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-export-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 3.5rem;
    }
}

/* ==========================================================================
   FOOTER DARK MODE ENHANCEMENTS - ENHANCED
   ========================================================================== */

/* Ensure footer has proper dark mode support with higher specificity */
footer {
    background-color: white !important;
    border-top-color: #e5e7eb !important;
}

.dark footer {
    background-color: #1f2937 !important;
    border-top-color: #374151 !important;
}

/* Footer text elements with higher specificity */
footer h3 {
    color: #111827 !important;
}

.dark footer h3 {
    color: #f9fafb !important;
}

footer p {
    color: #6b7280 !important;
}

.dark footer p {
    color: #d1d5db !important;
}

footer a {
    color: #6b7280 !important;
}

.dark footer a {
    color: #d1d5db !important;
}

/* Footer social icons with higher specificity */
footer .text-gray-400 {
    color: #9ca3af !important;
}

.dark footer .text-gray-400 {
    color: #6b7280 !important;
}

/* Footer borders with higher specificity */
footer .border-gray-200 {
    border-color: #e5e7eb !important;
}

.dark footer .border-gray-200 {
    border-color: #374151 !important;
}

footer .border-gray-300 {
    border-color: #d1d5db !important;
}

.dark footer .border-gray-300 {
    border-color: #4b5563 !important;
}

/* Footer hover states with higher specificity */
footer a:hover {
    color: #3b82f6 !important;
}

.dark footer a:hover {
    color: #60a5fa !important;
}

/* Footer background elements with higher specificity */
footer .bg-white {
    background-color: white !important;
}

.dark footer .bg-white {
    background-color: #1f2937 !important;
}

footer .bg-blue-50 {
    background-color: #eff6ff !important;
}

.dark footer .bg-blue-50 {
    background-color: #1e3a8a !important;
}

/* Footer text colors with higher specificity */
footer .text-gray-500 {
    color: #6b7280 !important;
}

.dark footer .text-gray-500 {
    color: #9ca3af !important;
}

footer .text-gray-600 {
    color: #4b5563 !important;
}

.dark footer .text-gray-600 {
    color: #d1d5db !important;
}

footer .text-gray-900 {
    color: #111827 !important;
}

.dark footer .text-gray-900 {
    color: #f9fafb !important;
}

/* Additional footer elements that might be missing dark mode */
footer .text-gray-700 {
    color: #374151 !important;
}

.dark footer .text-gray-700 {
    color: #d1d5db !important;
}

footer .text-gray-800 {
    color: #1f2937 !important;
}

.dark footer .text-gray-800 {
    color: #f9fafb !important;
}

/* Footer section backgrounds */
footer section {
    background-color: transparent !important;
}

.dark footer section {
    background-color: transparent !important;
}

/* Footer grid and layout elements */
footer .grid {
    background-color: transparent !important;
}

.dark footer .grid {
    background-color: transparent !important;
}

/* Footer border utilities */
footer .border-blue-100 {
    border-color: #dbeafe !important;
}

.dark footer .border-blue-100 {
    border-color: #1e3a8a !important;
}

footer .border-blue-200 {
    border-color: #bfdbfe !important;
}

.dark footer .border-blue-200 {
    border-color: #1e40af !important;
}

/* Footer spacing and layout */
footer .space-y-2 > * + * {
    margin-top: 0.5rem !important;
}

footer .space-y-3 > * + * {
    margin-top: 0.75rem !important;
}

/* Footer responsive elements */
@media (max-width: 768px) {
    footer {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .dark footer {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ==========================================================================
   SIDEBAR MOBILE OPTIMIZATION
   ========================================================================== */

/* Sidebar mobile-friendly styles */
.sidebar-mobile-optimized {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Ensure sidebar content doesn't scroll */
.sidebar-content {
    overflow: visible !important;
    max-height: none !important;
}

/* Mobile-friendly sidebar cards */
.sidebar-card {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dark .sidebar-card {
    background: #1f2937;
}

/* Responsive sidebar spacing */
@media (max-width: 640px) {
    .sidebar-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .sidebar-content {
        padding: 0;
    }
}

/* Ensure no horizontal scroll on mobile */
@media (max-width: 768px) {
    .sidebar-content {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ==========================================================================
   END OF STYLESHEET
   ========================================================================== */
