/* ========================================
   InPost Visual Feedback & Loading States
   Stylowanie dla inpost-visual-feedback.js
   ======================================== */

/* ==================== 
   1. PROGRESS BAR 
   ==================== */

.inpost-loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #FF6600, #FF8800);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
    transition: opacity 0.3s ease;
}

.inpost-loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.inpost-loading-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==================== 
   2. ZOOM HINTS 
   ==================== */

.inpost-zoom-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 102, 0, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    font-size: 13px;
    animation: slideDown 0.4s ease;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.inpost-zoom-hint .zoom-icon {
    font-size: 24px;
}

.inpost-zoom-hint .zoom-text {
    line-height: 1.4;
}

.inpost-zoom-hint strong {
    font-weight: 700;
    text-decoration: underline;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ==================== 
   3. SEARCH STATUS 
   ==================== */

.inpost-search-status {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    animation: fadeIn 0.3s ease;
}

.inpost-search-status-searching {
    background: #E3F2FD;
    color: #1976D2;
    border: 1px solid #90CAF9;
}

.inpost-search-status-success {
    background: #E8F5E9;
    color: #388E3C;
    border: 1px solid #81C784;
}

.inpost-search-status-warning {
    background: #FFF3E0;
    color: #F57C00;
    border: 1px solid #FFB74D;
}

.inpost-search-status-error {
    background: #FFEBEE;
    color: #D32F2F;
    border: 1px solid #E57373;
}

.inpost-search-status-sorting {
    background: #F3E5F5;
    color: #7B1FA2;
    border: 1px solid #CE93D8;
}

.status-icon {
    font-size: 18px;
}

.status-text {
    font-weight: 500;
}

/* ==================== 
   4. MAP SKELETON 
   ==================== */

.inpost-map-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 999;
    display: grid;
    grid-template-rows: 60px 1fr 200px;
    padding: 20px;
    gap: 15px;
}

.skeleton-header,
.skeleton-map,
.skeleton-item {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-header {
    height: 60px;
}

.skeleton-map {
    position: relative;
    border-radius: 12px;
}

.skeleton-marker {
    position: absolute;
    width: 30px;
    height: 40px;
    background: linear-gradient(135deg, #FF6600, #FF8800);
    border-radius: 50% 50% 50% 0;
    animation: skeleton-marker-pulse 2s infinite;
}

.skeleton-marker:nth-child(1) {
    top: 20%;
    left: 30%;
    animation-delay: 0s;
}

.skeleton-marker:nth-child(2) {
    top: 50%;
    left: 60%;
    animation-delay: 0.3s;
}

.skeleton-marker:nth-child(3) {
    top: 70%;
    left: 40%;
    animation-delay: 0.6s;
}

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-item {
    height: 60px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes skeleton-marker-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* ==================== 
   5. TOAST NOTIFICATIONS 
   ==================== */

.inpost-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    transform: translateX(120%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

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

.inpost-toast-success {
    background: #4CAF50;
    color: white;
}

.inpost-toast-error {
    background: #F44336;
    color: white;
}

.inpost-toast-warning {
    background: #FF9800;
    color: white;
}

.inpost-toast-info {
    background: #2196F3;
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 
   6. MOBILE RESPONSIVE 
   ==================== */

@media (max-width: 768px) {
    .inpost-zoom-hint {
        width: 90%;
        max-width: 320px;
        padding: 10px 15px;
        font-size: 12px;
    }

    .inpost-zoom-hint .zoom-icon {
        font-size: 20px;
    }

    .inpost-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
        font-size: 13px;
    }

    .inpost-loading-bar {
        height: 50px;
    }

    .inpost-loading-text {
        font-size: 12px;
    }
}

/* ==================== 
   7. ACCESSIBILITY 
   ==================== */

@media (prefers-reduced-motion: reduce) {
    .inpost-loading-text,
    .skeleton-marker {
        animation: none;
    }

    .inpost-zoom-hint {
        animation: none;
        opacity: 1;
    }

    .inpost-toast {
        transition: opacity 0.2s ease;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .inpost-loading-bar {
        border: 2px solid black;
    }

    .inpost-zoom-hint {
        border: 2px solid white;
    }

    .inpost-search-status {
        border-width: 2px;
    }
}
