/**
 * Kozijn Configurator Styles
 */

.kozijn-configurator-wrapper {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.kozijn-configurator-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.kozijn-input-group {
    width: 100%;
    position: relative;
}

.kozijn-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    font-family: "Ubuntu", Sans-serif;
}

.kozijn-input-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.kozijn-dimension-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #f9fafb;
    color: #374151;
}

.kozijn-dimension-input::placeholder {
    color: #d1d5db;
    font-weight: 400;
}

.kozijn-dimension-input:focus {
    outline: none;
    border-color: #9ca3af;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

.kozijn-dimension-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
    animation: shake 0.4s ease-in-out;
}

.kozijn-dimension-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.kozijn-dimension-input.valid {
    border-color: #84cc16;
    background-color: #f7fee7;
}

.kozijn-dimension-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Hint text below inputs */
.kozijn-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.3s ease;
}

.kozijn-hint.error-hint {
    color: #ef4444;
    font-weight: 600;
    animation: fadeIn 0.3s ease-in;
}

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

.kozijn-configurator-button-wrapper {
    text-align: left;
    margin-top: 10px;
}

.kozijn-configure-button {
    display: inline-block;
    padding: 16px 40px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #000000 !important;
    background: #a4d65e !important;
    background: linear-gradient(to bottom, #b4e36e 0%, #a4d65e 100%) !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
    min-width: 200px;
    text-align: center;
    font-family: "Ubuntu", Sans-serif !important;
}

.kozijn-configure-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.kozijn-configure-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #c0ed7e 0%, #b4e36e 100%) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px);
    border: none !important;
}

.kozijn-configure-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.kozijn-configure-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kozijn-configure-button.loading {
    padding-left: 55px;
}

/* Loading spinner */
.kozijn-configure-button .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(31, 41, 55, 0.3);
    border-top-color: #1f2937;
    border-radius: 50%;
    animation: kozijn-spin 0.7s linear infinite;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes kozijn-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Error message box */
.kozijn-configurator-error {
    margin-top: 20px;
    padding: 16px 18px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.6;
    animation: slideDown 0.3s ease-out;
}

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

.kozijn-error-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

.kozijn-error-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
}

.kozijn-error-list li:last-child {
    margin-bottom: 0;
}

.kozijn-error-list li:before {
    content: "⚠";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 16px;
    color: #ef4444;
}

/* Success checkmark animation */
.kozijn-dimension-input.valid {
    position: relative;
}

.kozijn-dimension-input.valid::after {
    content: "✓";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #84cc16;
    font-size: 20px;
    font-weight: bold;
    animation: checkmark 0.4s ease-in-out;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .kozijn-configurator-inputs {
        gap: 15px;
    }

    .kozijn-configure-button {
        width: 100%;
        text-align: center;
    }
}

/* Number input spinner buttons */
.kozijn-dimension-input::-webkit-inner-spin-button,
.kozijn-dimension-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 40px;
}

/* Focus glow effect */
.kozijn-dimension-input:focus {
    animation: focusGlow 0.3s ease-in-out;
}

@keyframes focusGlow {
    0% { box-shadow: 0 0 0 0 rgba(156, 163, 175, 0.4); }
    100% { box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1); }
}

/* Hide broken image icons completely */
img[id^="kozijn-preview-"] {
    /* Hide alt text on broken images */
    color: transparent;
    font-size: 0;
    /* Hide broken image icon */
    text-indent: -9999px;
}

img[id^="kozijn-preview-"]::before,
img[id^="kozijn-preview-"]::after {
    display: none !important;
}
