/**
 * VIN Decoder Styles
 * Modern, clean design for VIN decoder UI
 */

.vehizo-vin-decoder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    position: relative;
    overflow: hidden;
}

.vehizo-vin-decoder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.vin-decoder-header {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.vin-decoder-header h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vin-decoder-header .description {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 14px;
}

.vin-decoder-input-group {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    align-items: center;
}

#vehizo-vin-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#vehizo-vin-input:focus {
    outline: none;
    border-color: #fff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

#vehizo-vin-input.vin-valid {
    border-color: #10b981;
    background: #f0fdf4;
}

.vehizo-vin-decode-btn {
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #667eea !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.vehizo-vin-decode-btn:hover {
    background: #f8f9fa !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.vehizo-vin-decode-btn:active {
    transform: translateY(0);
}

.vehizo-vin-decode-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.vehizo-vin-decode-btn.loading .dashicons {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.vin-decoder-status {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
}

.vin-decoder-status .status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.vin-decoder-status.status-loading {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    display: flex;
}

.vin-decoder-status.status-loading .status-icon {
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
}

.vin-decoder-status.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 2px solid rgba(16, 185, 129, 0.3);
    display: flex;
}

.vin-decoder-status.status-success .status-icon::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #10b981;
    font-size: 16px;
    font-weight: bold;
}

.vin-decoder-status.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 2px solid rgba(239, 68, 68, 0.3);
    display: flex;
}

.vin-decoder-status.status-error .status-icon::before {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    font-size: 16px;
    font-weight: bold;
}

/* Field fill animation */
.vin-filled {
    animation: fieldFill 0.5s ease;
}

@keyframes fieldFill {
    0% {
        background-color: #fef3c7;
        transform: scale(1);
    }

    50% {
        background-color: #fde68a;
        transform: scale(1.02);
    }

    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Responsive design */
@media (max-width: 782px) {
    .vin-decoder-input-group {
        flex-direction: column;
    }

    .vehizo-vin-decode-btn {
        width: 100%;
        justify-content: center;
    }

    #vehizo-vin-input {
        width: 100%;
    }
}

/* WordPress admin table integration */
.form-table .vehizo-vin-decoder {
    margin: 0 0 20px 0;
}

.form-table td .vehizo-vin-decoder {
    margin: -10px -12px 20px -12px;
}