/**
 * HENX3D Template Configurator Styles
 * Styling für den personalisierbaren Produkt-Konfigurator
 */

/* ===================================
   Konfigurator Container
   =================================== */
.template-configurator {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.config-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
}

.config-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #00e5ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   Design-Auswahl Grid
   =================================== */
.design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.75rem;
}

.design-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 70px;
}

.design-option:hover {
    border-color: rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.1);
    transform: translateY(-2px);
}

.design-option.selected {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.design-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.design-name {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.design-price {
    font-size: 0.65rem;
    color: #00e5ff;
    font-weight: 500;
}

/* ===================================
   Text-Eingabe
   =================================== */
.text-zone-input {
    margin-bottom: 1rem;
}

.text-zone-input:last-child {
    margin-bottom: 0;
}

.text-zone-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.text-zone-input .required {
    color: #ff4444;
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.text-input {
    width: 100%;
    padding: 0.75rem 4rem 0.75rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    transition: all 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.char-counter {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* Größen-Slider */
.font-size-slider {
    margin-top: 0.75rem;
}

.font-size-slider label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.font-size-value {
    color: #00e5ff;
    font-weight: 600;
}

.size-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00e5ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    transition: transform 0.1s ease;
}

.size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00e5ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* ===================================
   Schrift-Auswahl
   =================================== */
.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.font-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 65px;
}

.font-option:hover {
    border-color: rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.1);
}

.font-option.selected {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.font-preview {
    font-size: 1.4rem;
    line-height: 1;
    color: white;
}

.font-name {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.font-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.font-badge.premium {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}

/* ===================================
   Preis-Anzeige
   =================================== */
.price-display {
    background: rgba(0, 229, 255, 0.05);
    border-color: rgba(0, 229, 255, 0.3);
}

.price-breakdown {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.breakdown-row.premium {
    color: #ffd700;
}

.breakdown-row span:last-child {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.total-price span {
    font-size: 1.5rem;
    color: #00e5ff;
}

/* ===================================
   Fehler-Anzeige
   =================================== */
.config-error {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.config-error p {
    margin-bottom: 1rem;
}

.config-error button {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 229, 255, 0.2);
    border: 1px solid #00e5ff;
    border-radius: 8px;
    color: #00e5ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-error button:hover {
    background: rgba(0, 229, 255, 0.3);
}

/* ===================================
   Validierungs-Fehler
   =================================== */
.text-zone-input.has-error .text-input {
    border-color: #ff4444;
}

.text-zone-input .error-message {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #ff4444;
}

.text-zone-input.has-error .error-message {
    display: block;
}

/* ===================================
   Responsive Anpassungen
   =================================== */
@media (max-width: 768px) {
    .config-section {
        padding: 1rem;
    }

    .design-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .design-option {
        padding: 0.5rem;
        min-height: 60px;
    }

    .design-icon {
        font-size: 1.3rem;
    }

    .design-name {
        font-size: 0.6rem;
    }

    .font-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .font-option {
        padding: 0.5rem;
        min-height: 55px;
    }

    .font-preview {
        font-size: 1.2rem;
    }

    .text-input {
        font-size: 1rem;
        padding: 0.65rem 3.5rem 0.65rem 0.85rem;
    }

    .total-price span {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .design-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .font-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .color-zones-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zone-preview {
        width: 40px;
        height: 40px;
    }
}

/* ===================================
   Animation
   =================================== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
    }
}

.design-option.selected,
.font-option.selected {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ===================================
   Mehrfarbdruck Sektion
   =================================== */
.multicolor-section {
    background: rgba(255, 0, 255, 0.05);
    border-color: rgba(255, 0, 255, 0.2);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.toggle-switch:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #ff00ff, #00e5ff);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: white;
}

.toggle-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.multicolor-options {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.color-zones-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-zone {
    text-align: center;
}

.color-zone label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.zone-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.color-zone:hover .zone-preview {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.color-picker {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.color-presets {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.presets-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 0.5rem;
}

.preset-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-btn:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.breakdown-row.multicolor {
    color: #ff00ff;
}

/* ===================================
   Loading State
   =================================== */
.template-configurator.loading {
    opacity: 0.6;
    pointer-events: none;
}

.template-configurator.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: #00e5ff;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}
