/**
 * Vehizo Admin Styles
 *
 * @package Vehizo
 * @version 4.1.0
 */

/* Security-safe status classes */
.vehizo-import-status {
    padding: 16px;
    border-radius: 8px;
    margin: 0;
}

.vehizo-status-success {
    background: #d1fae5;
    color: #047857;
    border-left: 4px solid #10b981;
}

.vehizo-status-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59b0b;
}

.vehizo-module-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.vehizo-module-name {
    font-weight: 500;
}

.vehizo-module-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
}

.vehizo-module-active {
    background: #d1fae5;
    color: #065f46;
}

.vehizo-module-inactive {
    background: #fef3c7;
    color: #92400e;
}

/* Additional admin utility classes */
.vehizo-help-box {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 16px;
}

.vehizo-reset-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.vehizo-reset-button {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fecaca;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.vehizo-error-box {
    padding: 20px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 8px;
}

.vehizo-vehicle-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.vehizo-vehicle-table thead {
    background: #f9fafb;
}

.vehizo-vehicle-row td {
    padding: 12px 0;
}

.vehizo-status-published {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.vehizo-edit-button {
    padding: 8px 16px;
    font-size: 12px;
    margin-right: 8px;
}

.vehizo-delete-button {
    padding: 8px 16px;
    font-size: 12px;
    background: #fee2e2;
    color: #b91c1c;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ef4444;
}

:root {
    --primary-color: #2563eb; 
    --primary-hover: #1d4ed8; 
    --success-color: #10b981; 
    --warning-color: #f59e0b; 
    --error-color: #ef4444; 
    --gray-50: #f9fafb; 
    --gray-100: #f3f4f6; 
    --gray-200: #e5e7eb; 
    --gray-300: #d1d5db; 
    --gray-400: #9ca3af; 
    --gray-500: #6b7280; 
    --gray-600: #4b5563; 
    --gray-700: #374151; 
    --gray-800: #1f2937; 
    --gray-900: #111827; 
    --border-radius: 12px;
}

/* WordPress Admin Menu Überschreibungen für Vehizo */
#adminmenu .wp-submenu li:first-child {
    /* Versteckt "All vehicles" falls es noch angezeigt wird */
    display: block !important;
}

/* Entfernt mögliche Duplikate im Submenu */
#adminmenu .wp-submenu a[href*="vehizo-vehicles"] {
    display: none !important;
}

/* Stellt sicher dass Dashboard-Link sichtbar ist */
#adminmenu .wp-submenu a[href*="vehizo-dashboard"] {
    display: block !important;
}

.wrap { 
    margin: 0; 
    padding: 0; 
}

.vehizo-dashboard { 
    max-width: 1400px; 
    margin: 20px auto; 
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e5ec 100%); 
    border-radius: var(--border-radius); 
    overflow: hidden; 
    min-height: 80vh; 
}

.vehizo-header { 
    background: #ffffff; 
    padding: 24px 40px 32px 40px; 
    display: flex; 
    align-items: center; 
    gap: 24px; 
    border-bottom: 1px solid var(--gray-200);
}

.vehizo-logo { 
    max-height: 50px; 
    width: auto; 
}

.vehizo-header h1 { 
    font-size: 28px; 
    font-weight: 700; 
    margin: 0; 
    color: var(--gray-700); 
}

.vehizo-nav { 
    background: #ffffff; 
    padding: 0 40px; 
    border-bottom: 1px solid var(--gray-200); 
}

.vehizo-nav .nav-tab-wrapper { 
    display: flex; 
    margin: 0; 
    border: none; 
    background: none; 
    gap: 8px; 
}

.vehizo-nav .nav-tab { 
    padding: 20px 24px; 
    border: none; 
    background: transparent; 
    color: var(--gray-600); 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 15px; 
    border-bottom: 3px solid transparent; 
    transition: all 0.3s ease; 
    margin: 0; 
}

.vehizo-nav .nav-tab:hover { 
    color: var(--primary-color); 
    background: #f8fafc;
}

.vehizo-nav .nav-tab.nav-tab-active { 
    color: var(--primary-color); 
    border-bottom-color: var(--primary-color); 
    background: white;
}

.vehizo-content { 
    background: var(--gray-50); 
    padding: 40px; 
    min-height: 600px; 
}

.vehizo-content-wrapper { 
    max-width: 1200px; 
    margin: 0 auto; 
}

.vehizo-section { 
    margin-bottom: 48px; 
}

.vehizo-section h2 { 
    color: var(--gray-800); 
    font-size: 24px; 
    font-weight: 600; 
    margin: 0 0 24px 0; 
    padding-bottom: 16px; 
    border-bottom: 1px solid var(--gray-200); 
}

.modern-button { 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    padding: 14px 28px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    transition: all 0.3s ease; 
    font-size: 14px;
}

.modern-button:hover { 
    background: var(--primary-hover); 
    color: white; 
    text-decoration: none; 
}

.modern-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.modern-button.secondary { 
    background: white; 
    color: var(--gray-700); 
    border: 1px solid var(--gray-300); 
}

.modern-button.secondary:hover { 
    background: var(--gray-100); 
    color: var(--gray-800); 
}

.modern-button:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
}

.stat-card { 
    background: white; 
    border: 1px solid var(--gray-200); 
    border-radius: var(--border-radius); 
    padding: 24px 16px; 
    text-align: center; 
    transition: all 0.3s ease; 
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-card h3 { 
    font-size: 36px; 
    font-weight: 800; 
    margin: 0 0 12px 0; 
    color: var(--primary-color); 
}

.stat-card p { 
    font-size: 14px; 
    color: var(--gray-600); 
    margin: 0; 
    font-weight: 500; 
}

.meta-box { 
    background: white; 
    border: 1px solid var(--gray-200); 
    border-radius: var(--border-radius); 
    padding: 24px; 
    margin-bottom: 24px; 
}

.meta-box h3 { 
    margin: 0 0 20px 0; 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--gray-800); 
}

/* Dashboard Widget Styles - verbessert */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-widgets .widget {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.dashboard-widgets .widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dashboard-widgets .widget h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.dashboard-widgets .widget p {
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Import Status Messages */
.import-status-success {
    background: #d1fae5;
    color: #047857;
    border-left: 4px solid #10b981;
}

.import-status-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.import-status-error {
    background: #fee2e2;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}

/* Status indicators */
.status-active {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-inactive {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-published {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Table styles */
.vehizo-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.vehizo-table thead {
    background: #f9fafb;
}

.vehizo-table th,
.vehizo-table td {
    padding: 20px;
    text-align: left;
}

.vehizo-table th {
    font-weight: 700;
}

.vehizo-table tbody tr:hover {
    background: #f9fafb;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Alert boxes */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.alert-success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #10b981;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Form improvements */
.form-table th {
    color: var(--gray-700);
    font-weight: 600;
}

.form-table input[type="text"],
.form-table input[type="password"],
.form-table input[type="email"],
.form-table select,
.form-table textarea {
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color 0.3s ease;
}

.form-table input:focus,
.form-table select:focus,
.form-table textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsive design - Enhanced for mobile issues */
@media (max-width: 768px) {
    .vehizo-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .vehizo-nav {
        padding: 0 20px;
    }

    .vehizo-nav .nav-tab-wrapper {
        flex-wrap: wrap;
        gap: 4px;
    }

    .vehizo-nav .nav-tab {
        padding: 12px 16px;
        font-size: 14px;
    }

    .vehizo-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
    }

    .stat-card {
        padding: 20px 12px;
    }

    /* Enhanced table responsive behavior */
    .vehizo-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border: 1px solid #e5e7eb;
    }

    .vehizo-table th,
    .vehizo-table td {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 100px;
    }

    /* Action buttons in tables */
    .vehizo-table .button,
    .vehizo-edit-button,
    .vehizo-delete-button {
        font-size: 11px;
        padding: 4px 8px;
        margin: 2px;
        display: inline-block;
        white-space: nowrap;
    }

    /* Module cards responsive */
    .dashboard-widgets {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-widgets .widget {
        padding: 16px;
    }

    /* Dashboard specific fixes */
    .meta-box {
        padding: 16px;
        margin-bottom: 16px;
    }

    .meta-box h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .vehizo-dashboard {
        margin: 10px;
        border-radius: 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modern-button {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }

    /* Modules page specific fixes */
    .dashboard-widgets .widget {
        padding: 12px;
    }

    .dashboard-widgets .widget h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .dashboard-widgets .widget p {
        font-size: 13px;
        line-height: 1.4;
    }

    /* Statistics page specific fixes */
    .chart-container {
        width: 100% !important;
        height: auto !important;
        min-height: 250px;
    }

    .chart-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Table action buttons stack vertically on very small screens */
    .vehizo-table .button,
    .vehizo-edit-button,
    .vehizo-delete-button {
        display: block;
        width: 100%;
        margin: 2px 0;
        text-align: center;
    }

    /* Better text wrapping for small screens */
    .vehizo-table {
        white-space: normal;
    }

    .vehizo-table th,
    .vehizo-table td {
        word-wrap: break-word;
        min-width: 80px;
    }
}

/* Additional responsive improvements for modules and statistics */
@media (max-width: 768px) {
    /* Module tips section */
    .module-tips {
        margin-top: 20px;
    }

    .module-tips h3 {
        font-size: 18px;
    }

    .module-tips ul {
        padding-left: 20px;
    }

    /* Statistics charts responsive */
    .statistics-section {
        margin-bottom: 30px;
    }

    .chart-wrapper {
        position: relative;
        height: 300px;
        width: 100%;
        margin-bottom: 20px;
    }

    .chart-wrapper canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Legend positioning for mobile */
    .chart-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .chart-legend-item {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
}

/* Dark mode support (if enabled by theme) */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-300: #6b7280;
        --gray-700: #d1d5db;
        --gray-800: #f3f4f6;
        --gray-900: #ffffff;
    }
}