/*
 * FlagRack Configurator Styles
 * Moderné štýly s animáciami pre konfigurátor
 */

/* =====================================================
   HLAVNÝ WRAPPER
   ===================================================== */
.flagrack-configurator {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   INSTRUCTIONS – ACCORDION
   ===================================================== */
.flagrack-instructions-accordion {
    margin-bottom: 24px;
    box-shadow: 0 2px 14px rgba(102, 126, 234, 0.14);
    overflow: hidden;
    background: #fff;
}

.flagrack-instructions-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
    cursor: pointer;
    list-style: none;
    user-select: none;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.flagrack-instructions-toggle::marker,
.flagrack-instructions-toggle::-webkit-details-marker {
    display: none;
    content: '';
}

.flagrack-instructions-arrow {
    flex-shrink: 0;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    transition: transform 0.25s ease;
}

.flagrack-instructions-accordion[open] .flagrack-instructions-arrow {
    transform: rotate(180deg);
}

.flagrack-instructions-body {
    background: #fff;
    border-top: none;
}

.flagrack-instruction-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 18px;
    transition: background 0.15s;
}

.flagrack-instruction-row:hover {
    background: #fafbff;
}

.flagrack-instruction-row + .flagrack-instruction-row {
    border-top: 1px solid #eff0f8;
}

.flagrack-instruction-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.flagrack-instruction-text {
    font-size: 13px;
    line-height: 1.5;
    color: #4a4a5a;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.flagrack-instruction-text strong {
    display: inline !important;
    color: #2c3366;
    font-weight: 700;
    margin-right: 5px;
    text-transform: none !important;
}

/* =====================================================
   SAVED CONFIGURATIONS
   ===================================================== */
.flagrack-saved-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #667eea;
}

.flagrack-saved-container h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.flagrack-saved-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.flagrack-saved-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.flagrack-saved-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(103, 126, 234, 0.15);
}

.flagrack-saved-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.flagrack-saved-info strong {
    color: #667eea;
    font-size: 16px;
}

.flagrack-saved-info span {
    color: #6c757d;
    font-size: 14px;
}

.flagrack-saved-remove {
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    line-height: 32px;
    padding: 0;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flagrack-saved-remove:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.5);
}

.flagrack-btn-add-all {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
}

/* =====================================================
   KROKY
   ===================================================== */
.flagrack-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.flagrack-step.active {
    display: block;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flagrack-step-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 30px 0;
    color: #2c3e50;
    text-align: center;
}

/* =====================================================
   KROK 1: VÝBER TYPU
   ===================================================== */
.flagrack-types-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.flagrack-type-option {
    background: #f8f9fa;
    border: 3px solid transparent;
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.flagrack-type-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.flagrack-type-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.flagrack-type-option:hover::before {
    left: 100%;
}

.flagrack-type-option.selected {
    border-color: #007cba;
    background: #e8f4f8;
    transform: scale(1.05);
}

.flagrack-type-option.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.flagrack-type-visual {
    margin-bottom: 15px;
}

.flagrack-type-option h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0 5px 0;
    color: #2c3e50;
}

.flagrack-type-option p {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

/* Vizualizácia rack-u */
.flagrack-rack {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 5px;
    background: #ecf0f1;
    border-radius: 6px;
    width: fit-content;
    margin: 0 auto;
}

.flagrack-slot {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    background: linear-gradient(180deg, #ecf0f1 0%, #bdc3c7 100%);
    border: 2px solid #95a5a6;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
}

.flagrack-slot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 2px dashed #95a5a6;
    border-radius: 2px;
}

/* =====================================================
   KROK 2: VÝBER VLAJOK
   ===================================================== */
.flagrack-configurator-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Interaktívna vizualizácia */
.flagrack-visual {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
}

.flagrack-rack-interactive {
    display: flex;
    gap: 0px;
    justify-content: center;
    padding: 0px;
    background: #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: none;
    margin: 0;
}

.flagrack-slot-interactive {
    flex: 1 1 0;
    width: auto;
    aspect-ratio: 1621 / 1218;
    padding: 0px;
    background: linear-gradient(180deg, #ecf0f1 0%, #bdc3c7 100%);
    border: 3px solid #95a5a6;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.flagrack-slot-interactive:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: #007cba;
}

.flagrack-slot-interactive.active {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3);
}

.flagrack-slot-interactive.filled {
    background: transparent;
    border-color: #27ae60;
}

.flagrack-slot-interactive.filled:hover {
    border-color: #e74c3c;
}

/* Placeholder v prázdnom slote */
.flagrack-slot-interactive.empty::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #95a5a6;
    transition: all 0.3s ease;
}

.flagrack-slot-interactive.empty:hover::before {
    color: #007cba;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Číslo slotu */
.flagrack-slot-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(52, 73, 94, 0.8);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* Vlajka v slote */
.flagrack-slot-flag {
    width: 100%;
    height: 100%;
    position: relative;
    animation: flagSlideIn 0.4s ease;
    padding: 0px;
    box-sizing: border-box;
}

@keyframes flagSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.flagrack-slot-flag img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 2px;
    background: #ffffff;
}

.flagrack-slot-flag-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
}

/* Tlačidlo na odstránenie */
.flagrack-slot-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 28px;
    padding: 0;
    z-index: 3;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
    flex-shrink: 0;
}

.flagrack-slot-interactive:hover .flagrack-slot-remove {
    opacity: 1;
    transform: scale(1);
}

.flagrack-slot-remove:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.5);
}

/* =====================================================
   FLAG SELECTOR DROPDOWN
   ===================================================== */
.flagrack-flag-selector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 700px;
    max-height: 65vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.flagrack-flag-selector.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -45%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Overlay */
.flagrack-flag-selector::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    backdrop-filter: blur(8px);
    z-index: -1;
}

.flagrack-flag-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.flagrack-flag-selector-header h4 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.flagrack-close-selector {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: 300;
}

.flagrack-close-selector:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    transform: rotate(90deg) scale(1.1);
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flagrack-flag-list {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    align-content: start;
    background: rgba(255, 255, 255, 0.5);
}

/* Custom scrollbar */
.flagrack-flag-list::-webkit-scrollbar {
    width: 10px;
}

.flagrack-flag-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    margin: 10px 0;
}

.flagrack-flag-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.flagrack-flag-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

.flagrack-flag-option {
    cursor: pointer;
    padding: 18px 15px;
    background: #ffffff;
    border: 2px solid rgba(103, 126, 234, 0.1);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.flagrack-flag-option:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border-color: #667eea;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(103, 126, 234, 0.2);
}

.flagrack-flag-option.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.6);
}

.flagrack-flag-image {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.flagrack-flag-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flagrack-flag-placeholder {
    flex: 1;
    min-width: 30px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

.flagrack-flag-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flagrack-flag-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.2px;
}

/* =====================================================
   SELECTED SUMMARY
   ===================================================== */
.flagrack-selected-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.flagrack-selected-summary h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

#flagrack-selected-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#flagrack-selected-list li {
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#flagrack-selected-list .slot-number {
    background: #007cba;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* =====================================================
   AKČNÉ TLAČIDLÁ
   ===================================================== */
.flagrack-step-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.flagrack-step-actions button {
    padding: 14px 28px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer;
}

.flagrack-btn-next,
.flagrack-btn-add-to-cart {
    background: #007cba !important;
    color: white !important;
}

.flagrack-btn-add-another {
    background: #667eea !important;
    color: white !important;
}

.flagrack-btn-add-another:hover:not(:disabled) {
    background: #764ba2 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(103, 126, 234, 0.3) !important;
}

.flagrack-btn-next:hover:not(:disabled),
.flagrack-btn-add-to-cart:hover:not(:disabled) {
    background: #005a87 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3) !important;
}

.flagrack-btn-back {
    background: #95a5a6 !important;
    color: white !important;
}

.flagrack-btn-back:hover {
    background: #7f8c8d !important;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* =====================================================
   NOTIFIKÁCIE
   ===================================================== */
.flagrack-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    animation: zoomIn 0.3s ease;
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    font-size: 16px;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.flagrack-notification.error {
    border-left: 6px solid #e74c3c;
    color: #e74c3c;
}

.flagrack-notification.success {
    border-left: 6px solid #27ae60;
    color: #27ae60;
}

.flagrack-notification.info {
    border-left: 6px solid #3498db;
    color: #3498db;
}

/* =====================================================
   KOŠÍK
   ===================================================== */
.flagrack-cart-info,
.flagrack-order-info {
    display: block;
    margin-top: 8px;
    color: #7f8c8d;
    line-height: 1.6;
}

.flagrack-cart-info strong,
.flagrack-order-info strong {
    color: #2c3e50;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .flagrack-configurator {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .flagrack-types-grid {
        grid-template-columns: 1fr;
    }

    .flagrack-slot {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
    }
    
    .flagrack-rack-interactive {
        gap: 10px;
        padding: 20px 10px;
    }
    
    .flagrack-slot-interactive {
        min-width: 60px;
    }
    
    .flagrack-flag-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .flagrack-step-actions {
        flex-direction: column;
    }
    
    .flagrack-step-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .flagrack-slot-interactive {
        min-width: 50px;
    }
    
    .flagrack-rack-interactive {
        gap: 8px;
    }
}

/* =====================================================
   FINAL ACTION BUTTON
   ===================================================== */
.flagrack-final-action {
    text-align: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.flagrack-final-action .button-large {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.flagrack-final-action .button-large:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.flagrack-final-action .button-large:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hide global action while selector is open */
body.flagrack-selector-open .flagrack-final-action {
    opacity: 0;
    pointer-events: none;
}

.flagrack-final-help-text {
    margin-top: 15px;
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 0;
}
