/* 
 * Lenovo Konfigurationsassistent - Components CSS
 * UI-Komponenten wie Buttons, Karten, Inputs und mehr
 */

/* Icons */
.lenovo-form-container .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
    display: inline-block;
}

.lenovo-form-container .card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--lenovo-light-gray);
    border-radius: 50%;
    margin-bottom: var(--spacing-md);
    transition: var(--transition-normal);
}

.lenovo-form-container .card-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--lenovo-gray);
    transition: var(--transition-normal);
}

/* Buttons */
.lenovo-form-container .btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    min-width: 120px;
    text-align: center;
    display: inline-block;
    line-height: 1.2;
    font-size: 1rem;
    background-image: none;
    text-shadow: none;
    letter-spacing: normal;
}

.lenovo-form-container .btn-secondary {
    background-color: var(--lenovo-light-gray);
    color: var(--lenovo-dark-gray);
}

.lenovo-form-container .btn-secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.lenovo-form-container .btn-primary {
    background-color: var(--lenovo-red);
    color: white;
}

.lenovo-form-container .btn-primary:hover {
    background-color: var(--lenovo-dark-red);
}

.lenovo-form-container .btn-submit {
    background-color: var(--lenovo-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.lenovo-form-container .btn-submit:hover {
    background-color: var(--lenovo-dark-red);
}

.lenovo-form-container .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lenovo-form-container .btn.ready-to-proceed {
    animation: pulse 1.5s infinite;
}

/* Karten und Cards */
.use-case-card {
    background-color: white;
    border: 1px solid var(--lenovo-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.use-case-card:hover {
    border-color: var(--lenovo-red);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.use-case-card.selected {
    border-color: var(--lenovo-red);
    background-color: var(--lenovo-light-red);
}

.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--lenovo-red);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-bottom-left-radius: var(--radius-sm);
    z-index: 1;
}

.use-case-card:hover .card-icon,
.use-case-card.selected .card-icon {
    background-color: var(--lenovo-red);
}

.use-case-card:hover .card-icon svg,
.use-case-card.selected .card-icon svg {
    fill: white;
}

.use-case-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.use-case-card p {
    font-size: 0.9rem;
    color: var(--lenovo-gray);
    flex-grow: 1;
    margin-bottom: 0;
}

/* Alternative Karten */
.alternative-card {
    background-color: white;
    border: 1px solid var(--lenovo-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.alternative-card:hover {
    border-color: var(--lenovo-red);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.alternative-card.selected {
    border: 2px solid var(--lenovo-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.alt-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--lenovo-info);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-bottom-left-radius: 3px;
    z-index: 1;
}

/* Form Elemente */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    font-size: 0.95rem;
}

.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.option-button {
    flex: 1;
    min-width: 80px;
    cursor: pointer;
    position: relative;
}

.option-button input {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

.option-button span {
    display: block !important;
    text-align: center !important;
    padding: var(--spacing-sm) !important;
    background-color: white !important;
    border: 1px solid var(--lenovo-border) !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition-fast) !important;
    font-size: 0.9rem !important;
}

.option-button:hover span {
    border-color: var(--lenovo-red) !important;
}

.option-button input:checked + span {
    background-color: var(--lenovo-red) !important;
    color: white !important;
    border-color: var(--lenovo-red) !important;
    font-weight: 500 !important;
}

.option-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.option-item {
    background: none;
    border: 1px solid var(--lenovo-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-family: var(--font-family-lenovo);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.option-item:hover:not(.active):not(.disabled) {
    border-color: var(--lenovo-red);
    background-color: var(--lenovo-light-red);
}

.option-item.active {
    background-color: var(--lenovo-red);
    color: white;
    border-color: var(--lenovo-red);
}

.option-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--lenovo-light-gray);
    color: var(--lenovo-gray);
}

/* Tabs */
.config-tabs {
    display: flex;
    border-bottom: 1px solid var(--lenovo-border);
}

.config-tab {
    flex: 1;
    padding: var(--spacing-md);
    text-align: center;
    background: none;
    border: none;
    font-family: var(--font-family-lenovo);
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--lenovo-gray);
    transition: var(--transition-fast);
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--lenovo-red);
    transition: var(--transition-fast);
}

.config-tab:hover {
    color: var(--lenovo-dark-gray);
}

.config-tab.active {
    color: var(--lenovo-red);
    font-weight: 500;
}

.config-tab.active::after {
    width: 50%;
    animation: tabHighlight 0.3s ease-in-out;
}

/* Sliders und Range-Inputs */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: #ddd;
    outline: none;
    margin-top: 8px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lenovo-red);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lenovo-red);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

/* Budget-Skala */
.budget-scale {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #4caf50, #ffc107, #f44336);
    border-radius: var(--radius-full);
    margin: 10px 0;
    position: relative;
    z-index: 0;
}

.budget-marker {
    position: absolute;
    top: -6px;
    width: 18px;
    height: 18px;
    background-color: white;
    border: 2px solid var(--lenovo-red);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.budget-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--lenovo-gray);
    position: relative;
    z-index: 1;
}

/* Qualitäts-Indikatoren */
.quality-value {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.quality-value.budget {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.quality-value.standard {
    background-color: #e3f2fd;
    color: #0277bd;
}

.quality-value.premium {
    background-color: #fce4ec;
    color: #c2185b;
}

.quality-value.high-end {
    background-color: #efd0c2;
    color: #7a3b2e;
}

.quality-value:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

/* Standard Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--lenovo-border);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: var(--lenovo-red);
    outline: none;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox-Komponente - FIXED STYLING */
.lenovo-form-container .checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    cursor: pointer !important;
    margin-bottom: var(--spacing-sm) !important;
    padding: var(--spacing-xs) !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition-fast) !important;
    position: relative !important;
}

.lenovo-form-container .checkbox-label:hover {
    background-color: var(--lenovo-light-gray) !important;
}

.lenovo-form-container .checkbox-custom {
    position: relative !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid var(--lenovo-gray) !important;
    border-radius: var(--radius-sm) !important;
    margin-right: var(--spacing-sm) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: white !important;
    transition: all 0.2s ease !important;
    margin-top: 2px !important;
}

.lenovo-form-container .checkbox-label input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer !important;
    height: 0 !important;
    width: 0 !important;
}

.lenovo-form-container .checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: var(--lenovo-red) !important;
    border-color: var(--lenovo-red) !important;
}

.lenovo-form-container .checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓' !important;
    position: absolute !important;
    color: white !important;
    font-size: 14px !important;
    line-height: 1 !important;
    top: -1px !important;
    left: 3px !important;
}

.lenovo-form-container .checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    outline: 2px solid var(--lenovo-light-red) !important;
    outline-offset: 1px !important;
}

/* Make sure the actual checkbox looks good in all browsers */
.lenovo-form-container input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #fff !important;
    margin: 0 !important;
}

/* Fix for Focus visibility */
.lenovo-form-container input[type="checkbox"]:focus {
    outline: none !important;
}

/* Step 2 Tag Checkboxes - FIXED STYLING */
.lenovo-form-container #step-2 .tag-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 1rem !important;
}

.lenovo-form-container #step-2 .tag-item {
    position: relative !important;
    padding: 4px 10px 4px 28px !important; /* Extra padding for checkbox */
    background-color: #f8f8f8 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
}

.lenovo-form-container #step-2 .tag-item span {
    position: relative !important;
    font-size: 0.9rem !important;
}

.lenovo-form-container #step-2 .tag-item span::before {
    content: "" !important;
    position: absolute !important;
    left: -24px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 14px !important;
    height: 14px !important;
    border: 1px solid #999 !important;
    border-radius: 3px !important;
    background-color: white !important;
}

.lenovo-form-container #step-2 .tag-item input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

.lenovo-form-container #step-2 .tag-item input[type="checkbox"]:checked + span::before {
    background-color: #e31e24 !important;
    border-color: #e31e24 !important;
}

.lenovo-form-container #step-2 .tag-item input[type="checkbox"]:checked + span::after {
    content: "✓" !important;
    position: absolute !important;
    color: white !important;
    font-size: 10px !important;
    left: -21px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
}

.lenovo-form-container #step-2 .tag-item:hover {
    background-color: #f0f0f0 !important;
    border-color: #ccc !important;
}

.lenovo-form-container #step-2 .tag-item input[type="checkbox"]:checked + span {
    font-weight: 500 !important;
}

/* Extras Categories */
.extras-category {
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    font-family: var(--font-family-lenovo);
    font-size: 0.9rem;
    color: var(--lenovo-gray);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.extras-category[data-category="software"] {
    position: relative;
    padding-right: 24px;
}

.extras-category[data-category="software"]::after {
    content: 'Neu';
    position: absolute;
    top: -8px;
    right: 0;
    background-color: var(--lenovo-red);
    color: white;
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: var(--radius-full);
    font-weight: bold;
    line-height: 1;
    z-index: 10;
}

.extras-category.active {
    color: var(--lenovo-red);
    font-weight: 500;
}

.extras-category.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--lenovo-red);
}

/* Extra Items */
.extra-item {
    background-color: white;
    border: 1px solid var(--lenovo-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    transition: var(--transition-fast);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.extra-item:hover {
    border-color: var(--lenovo-red);
    box-shadow: var(--shadow-md);
}

.extra-item.selected {
    border-color: var(--lenovo-red);
    box-shadow: var(--shadow-sm);
    background-color: var(--lenovo-light-red);
}

.extra-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--lenovo-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-bottom-left-radius: 3px;
    z-index: 1;
}

.extra-image {
    width: 100%;
    padding-bottom: 70%;
    position: relative;
    overflow: hidden;
    background-color: #f9f9f9;
}

.extra-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--spacing-xs);
}

.extra-info {
    padding: var(--spacing-sm);
    flex-grow: 1;
}

.extra-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.extra-description {
    font-size: 0.8rem;
    color: var(--lenovo-gray);
    margin-bottom: 4px;
}

.extra-add-btn {
    width: 100%;
    padding: var(--spacing-sm);
    background-color: var(--lenovo-light-gray);
    color: var(--lenovo-dark-gray);
    border: none;
    font-family: var(--font-family-lenovo);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: auto;
}

.extra-add-btn:hover {
    background-color: var(--lenovo-red);
    color: white;
    transform: translateY(-2px);
}

/* Service Items */
.service-item {
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid var(--lenovo-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition-fast);
    height: 100%;
    padding: var(--spacing-md);
}

.service-item:hover {
    border-color: var(--lenovo-red);
    box-shadow: var(--shadow-sm);
}

.service-item.selected {
    border-color: var(--lenovo-red);
    background-color: var(--lenovo-light-red);
}

.service-info {
    flex-grow: 1;
}

.service-name {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.service-description {
    font-size: 0.85rem;
    color: var(--lenovo-gray);
    margin-bottom: 6px;
}

.service-price {
    font-weight: 600;
    color: var(--lenovo-red);
    font-size: 0.95rem;
}

.service-checkbox {
    margin-right: var(--spacing-sm);
}

/* Success/Error Messages */
.success-message {
    text-align: center;
    padding: 2rem;
    background-color: #f8f8f8;
    border-radius: var(--radius-md);
    animation: fadeIn 0.5s ease-in-out;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #4caf50;
    color: white;
    border-radius: 50%;
    font-size: 40px;
    margin-bottom: 1.5rem;
}

.error-message {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    color: #b71c1c;
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.error-text strong {
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* Info Box & Tooltip */
.info-box {
    background-color: var(--lenovo-light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
}

.info-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-text {
    font-size: 0.85rem;
    color: var(--lenovo-gray);
}

/* Tooltip Components */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-style: italic;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.info-tooltip:hover {
    background-color: rgba(255,255,255,0.3);
}

.info-tooltip .tooltip-content {
    position: absolute;
    top: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    max-width: 90vw;
    white-space: normal;
    background: #fff;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1100;
    pointer-events: none;
    text-align: left;
    transform: translateX(-50%) translateY(5px);
}

.info-tooltip .tooltip-content::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

.info-tooltip:hover .tooltip-content,
.info-tooltip.active .tooltip-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.info-tooltip.active {
    z-index: 1200;
}

.aos-link {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 10px;
    background-color: var(--lenovo-light-gray);
    color: var(--lenovo-red);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 12px;
}

.aos-link:hover {
    background-color: var(--lenovo-red);
    color: white;
}

/* Validation Styles */
.validation-highlight {
    border: 2px solid var(--lenovo-red) !important;
    animation: pulse-validation 1.5s infinite;
}

.validation-error {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 1px rgba(244, 67, 54, 0.2) !important;
}

/* Focus Styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--lenovo-red);
    outline-offset: 2px;
}

:focus-visible {
    outline: 2px solid var(--lenovo-red);
    outline-offset: 2px;
}