/**
 * Additional features CSS: Modals, Notifications, Transitions, etc.
 */

/* ===== MODAL / QUICK START GUIDE ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
    color: var(--text-secondary);
}

.guide-step {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.guide-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.guide-step h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.guide-step ul {
    margin-left: 20px;
    margin-top: 10px;
}

.guide-step li {
    margin-bottom: 8px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== PLATE NOT FOUND MODAL ===== */
.plate-not-found-modal .plate-not-found-content {
    text-align: center;
    padding: 40px 35px;
    max-width: 420px;
}

.plate-not-found-icon {
    font-size: 3.5em;
    margin-bottom: 16px;
    opacity: 0.9;
}

.plate-not-found-title {
    margin: 0 0 12px 0;
    font-size: 1.5em;
    color: var(--text-primary);
}

.plate-not-found-message {
    margin: 0 0 28px 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.05em;
}

.plate-not-found-close {
    min-width: 180px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 10001;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(20px);
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-info {
    border-left: 4px solid var(--accent-color);
}

.toast-info .toast-icon {
    color: var(--accent-color);
}

.toast-message {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

/* ===== LOADING ANIMATIONS ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ===== SMOOTH TRANSITIONS ===== */
/* Only apply transitions to colors and borders, not opacity/transform for UI elements */
/* UI elements should load immediately without fade-in effects */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Remove opacity/transform transitions from UI elements - they should appear immediately */
.form-panel, .preview-panel {
    /* No opacity/transform transitions - load immediately */
    opacity: 1 !important;
    transform: none !important;
}

.gallery-item, .history-item {
    /* Only transition box-shadow for hover effects, not opacity */
    transition: box-shadow 0.3s ease;
    opacity: 1 !important;
}

.btn, .nav-link, header, .header-content {
    /* Only transition colors and transform for hover, not opacity */
    opacity: 1 !important;
}

.btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

input, select, textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    opacity: 1 !important;
}

/* ===== PROGRESSIVE IMAGE LOADING ===== */
.progressive-image {
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.progressive-image img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.progressive-image img.loaded {
    opacity: 1;
}

.progressive-image .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.9em;
    transition: opacity 0.5s ease;
}

.progressive-image img.loaded + .placeholder {
    opacity: 0;
    pointer-events: none;
}

/* ===== LAZY LOADING ===== */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* ===== SUCCESS/ERROR STATES ===== */
.success-state {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.error-state {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }
}

