/**
 * Vehizo Mobile Importer Styles
 *
 * Admin styles for the external API import functionality
 *
 * @package Vehizo
 * @since 1.0.0
 */

/* Import Container */
.vehizo-import-container {
    max-width: 800px;
    margin: 20px 0;
}

/* Import Status */
.vehizo-import-status {
    margin: 15px 0;
}

.vehizo-import-status .notice {
    padding: 12px 15px;
    border-left: 4px solid;
    margin: 5px 0 15px 0;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.vehizo-import-status .notice-success {
    border-left-color: #46b450;
}

.vehizo-import-status .notice-error {
    border-left-color: #dc3232;
}

.vehizo-import-status .notice-info {
    border-left-color: #00a0d2;
}

.vehizo-import-status .notice-warning {
    border-left-color: #ffb900;
}

/* Progress Bar */
.vehizo-progress-wrapper {
    margin: 15px 0;
    padding: 10px;
    background: #f1f1f1;
    border-radius: 4px;
}

.vehizo-progress-bar {
    position: relative;
    height: 30px;
    background: #e1e1e1;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.vehizo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 15px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vehizo-progress-fill:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: vehizo-progress-move 2s linear infinite;
}

@keyframes vehizo-progress-move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.vehizo-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}

/* Import Statistics */
.vehizo-import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.vehizo-stat-box {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    text-align: center;
}

.vehizo-stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #0073aa;
    display: block;
    line-height: 1;
}

.vehizo-stat-label {
    color: #646970;
    font-size: 13px;
    margin-top: 5px;
}

/* Buttons */
.vehizo-button-group {
    margin: 15px 0;
}

.vehizo-button-group .button {
    margin-right: 10px;
    margin-bottom: 5px;
}

.button.vehizo-button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.button.vehizo-button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.button.vehizo-button-secondary {
    background: #f1f1f1;
    border-color: #ccd0d4;
    color: #0073aa;
}

.button.vehizo-button-secondary:hover {
    background: #e1e1e1;
    border-color: #999;
}

.button:disabled,
.button[disabled] {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* API Test Section */
.vehizo-api-test {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin: 20px 0;
}

.vehizo-api-test h3 {
    margin-top: 0;
    color: #333;
}

/* Settings Table */
.vehizo-settings-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.vehizo-settings-table th,
.vehizo-settings-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.vehizo-settings-table th {
    background: #f1f1f1;
    font-weight: 600;
    color: #333;
}

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

/* Status Indicators */
.vehizo-status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.vehizo-status-success {
    background: #46b450;
}

.vehizo-status-error {
    background: #dc3232;
}

.vehizo-status-warning {
    background: #ffb900;
}

.vehizo-status-info {
    background: #00a0d2;
}

/* Import Log */
.vehizo-import-log {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
}

.vehizo-log-entry {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f1f1;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.4;
}

.vehizo-log-entry:last-child {
    border-bottom: none;
}

.vehizo-log-entry.success {
    color: #046b17;
}

.vehizo-log-entry.error {
    color: #d63638;
}

.vehizo-log-entry.warning {
    color: #a66600;
}

.vehizo-log-timestamp {
    color: #666;
    margin-right: 8px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .vehizo-import-stats {
        grid-template-columns: 1fr;
    }
    
    .vehizo-button-group .button {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .vehizo-settings-table {
        font-size: 14px;
    }
    
    .vehizo-settings-table th,
    .vehizo-settings-table td {
        padding: 8px 10px;
    }
}

/* Loading Spinner */
.vehizo-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: vehizo-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Tooltips */
.vehizo-tooltip {
    position: relative;
    cursor: help;
}

.vehizo-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.vehizo-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Accordion Sections */
.vehizo-accordion {
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin: 20px 0;
}

.vehizo-accordion-header {
    background: #f1f1f1;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #ccd0d4;
    position: relative;
}

.vehizo-accordion-header:hover {
    background: #e1e1e1;
}

.vehizo-accordion-header::after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.vehizo-accordion.collapsed .vehizo-accordion-header::after {
    transform: translateY(-50%) rotate(-90deg);
}

.vehizo-accordion-content {
    padding: 20px;
    display: block;
    transition: max-height 0.3s ease;
}

.vehizo-accordion.collapsed .vehizo-accordion-content {
    display: none;
}

/* Form Elements */
.vehizo-form-table {
    width: 100%;
}

.vehizo-form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
    text-align: left;
    font-weight: 600;
}

.vehizo-form-table td {
    padding: 15px 10px 20px 0;
    vertical-align: top;
}

.vehizo-form-table input[type="text"],
.vehizo-form-table input[type="url"],
.vehizo-form-table input[type="password"],
.vehizo-form-table select,
.vehizo-form-table textarea {
    width: 100%;
    max-width: 400px;
}

.vehizo-form-table .description {
    color: #646970;
    font-style: italic;
    margin-top: 5px;
    font-size: 13px;
}

/* Badges */
.vehizo-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 10px;
    vertical-align: middle;
}

.vehizo-badge-success {
    background: #d5f4e6;
    color: #046b17;
}

.vehizo-badge-error {
    background: #f8d7da;
    color: #721c24;
}

.vehizo-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.vehizo-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Cards */
.vehizo-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.vehizo-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ccd0d4;
    background: #f9f9f9;
    font-weight: 600;
}

.vehizo-card-body {
    padding: 20px;
}

.vehizo-card-footer {
    padding: 15px 20px;
    border-top: 1px solid #ccd0d4;
    background: #f9f9f9;
    text-align: right;
}

/* Alerts */
.vehizo-alert {
    padding: 12px 15px;
    margin: 15px 0;
    border: 1px solid;
    border-radius: 4px;
    position: relative;
}

.vehizo-alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.vehizo-alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.vehizo-alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.vehizo-alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.vehizo-alert-dismissible {
    padding-right: 35px;
}

.vehizo-alert-dismiss {
    position: absolute;
    top: 0;
    right: 0;
    padding: 12px 15px;
    color: inherit;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
}

.vehizo-alert-dismiss:hover {
    opacity: 1;
}

/* Data Tables */
.vehizo-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;
}

.vehizo-data-table th,
.vehizo-data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.vehizo-data-table th {
    background: #f1f1f1;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.vehizo-data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Pagination */
.vehizo-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 5px;
}

.vehizo-pagination a,
.vehizo-pagination span {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ccd0d4;
    background: #fff;
    color: #0073aa;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.vehizo-pagination a:hover {
    background: #f1f1f1;
    border-color: #999;
}

.vehizo-pagination .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.vehizo-pagination .disabled {
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

/* Media Queries for Better Mobile Support */
@media screen and (max-width: 600px) {
    .vehizo-form-table th,
    .vehizo-form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .vehizo-form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
    
    .vehizo-data-table {
        font-size: 14px;
    }
    
    .vehizo-data-table th,
    .vehizo-data-table td {
        padding: 8px 10px;
    }
    
    .vehizo-card-header,
    .vehizo-card-body,
    .vehizo-card-footer {
        padding: 15px;
    }
}

/* Dark Mode Support (if WordPress admin uses dark colors) */
@media (prefers-color-scheme: dark) {
    .vehizo-card,
    .vehizo-data-table {
        background: #1e1e1e;
        border-color: #3c3c3c;
        color: #e1e1e1;
    }
    
    .vehizo-card-header,
    .vehizo-data-table th {
        background: #2c2c2c;
        color: #e1e1e1;
        border-color: #3c3c3c;
    }
    
    .vehizo-data-table tbody tr:hover {
        background: #2a2a2a;
    }
    
    .vehizo-progress-bar {
        background: #3c3c3c;
    }
    
    .vehizo-accordion-header {
        background: #2c2c2c;
        color: #e1e1e1;
    }
    
    .vehizo-accordion-header:hover {
        background: #3c3c3c;
    }
}