/**
 * Deck & Wurfmeldung Modern - Frontend CSS
 * Design basierend auf Zwingernamen-Antrag Plugin
 */

/* Container */
.dwm-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Success/Error Messages */
.dwm-success, .dwm-error {
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 32px;
    animation: slideIn 0.4s ease-out;
}

.dwm-success {
    background: linear-gradient(135deg, #d4f8e7 0%, #bfe6d9 100%);
    border: 2px solid #86e3ce;
    color: #065f46;
}

.dwm-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #fca5a5;
    color: #991b1b;
}

.dwm-success-icon, .dwm-error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.dwm-success-icon {
    background: #10b981;
    color: white;
}

.dwm-error-icon {
    background: #ef4444;
    color: white;
}

.dwm-sid {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(91, 111, 216, 0.1);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #1e40af;
}

/* Form Wrapper */
.dwm-form-wrapper {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Form Header */
.dwm-form-header {
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, #1a1d3a 0%, #2d1b4e 100%);
    color: white;
}

.dwm-form-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: white;
}

.dwm-form-header p {
    margin: 0;
    font-size: 15px;
    opacity: 0.9;
}

/* Progress Bar */
.dwm-progress {
    display: flex;
    padding: 24px 32px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 8px;
}

.dwm-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.dwm-progress-step.dwm-active,
.dwm-progress-step.dwm-completed {
    opacity: 1;
}

.dwm-step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
}

.dwm-progress-step.dwm-active .dwm-step-number {
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 111, 216, 0.3);
}

.dwm-progress-step.dwm-completed .dwm-step-number {
    background: #10b981;
    color: white;
}

.dwm-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

/* Step-Label gut lesbar (insb. Schritt 5) */
.dwm-progress-step.dwm-active .dwm-step-label,
.dwm-progress-step.dwm-completed .dwm-step-label {
    color: #111827;
}

/* Form Steps */
.dwm-form {
    padding: 32px;
    position: relative;
    min-height: 600px; /* Genug Platz für versteckte Steps */
}

.dwm-step {
    /* WICHTIG: Nicht display:none verwenden, da sonst File-Inputs ihre Referenz verlieren */
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 32px;
    left: 32px;
    right: 32px;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.dwm-step.dwm-active {
    visibility: visible;
    opacity: 1;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    pointer-events: auto;
}

.dwm-step-title {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 12px;
    border-bottom: 2px solid #5b6fd8;
}

/* Grid */
.dwm-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.dwm-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.dwm-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Form Fields */
.dwm-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dwm-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.dwm-required {
    color: #ef4444;
}

/* Inputs */
.dwm-input, .dwm-select, .dwm-textarea, .dwm-file {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s;
    outline: none;
}

.dwm-input:focus, .dwm-select:focus, .dwm-textarea:focus {
    border-color: #5b6fd8;
    box-shadow: 0 0 0 4px rgba(91, 111, 216, 0.1);
}

.dwm-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.dwm-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.dwm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.dwm-btn svg {
    flex-shrink: 0;
}

.dwm-btn-primary {
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 111, 216, 0.3);
}

.dwm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(91, 111, 216, 0.4);
}

.dwm-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.dwm-btn-secondary:hover {
    background: #e5e7eb;
}

.dwm-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.dwm-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.dwm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Kitten Cards */
.dwm-kitten-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
}

.dwm-kitten-card h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.dwm-btn-remove-kitten {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    font-size: 13px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
}

.dwm-btn-remove-kitten:hover {
    background: #fecaca;
}

.dwm-btn-add-kitten {
    width: 100%;
    margin-bottom: 16px;
    background: white;
    border: 2px dashed #5b6fd8;
    color: #5b6fd8;
}

.dwm-btn-add-kitten:hover {
    background: rgba(91, 111, 216, 0.05);
}

/* Checkboxes */
.dwm-checkbox-group {
    margin-bottom: 16px;
}

.dwm-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.dwm-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dwm-checkbox-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    transition: all 0.2s;
    position: relative;
    margin-top: 2px;
}

.dwm-checkbox:checked + .dwm-checkbox-custom {
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    border-color: #5b6fd8;
}

.dwm-checkbox:checked + .dwm-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dwm-required-group {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    padding: 16px;
    border-radius: 12px;
}

.dwm-required-group .dwm-checkbox-label span {
    color: #111827 !important;
    font-weight: 600;
}

.dwm-required-group .dwm-checkbox-label {
    color: #111827 !important;
}

.dwm-required-group strong {
    color: #111827 !important;
}

.dwm-required-group p {
    color: #111827 !important;
}

/* Alle Texte in Schritt 5 sollen schwarz sein */
.dwm-step[data-step="5"] .dwm-checkbox-label,
.dwm-step[data-step="5"] .dwm-checkbox-label span,
.dwm-step[data-step="5"] p,
.dwm-step[data-step="5"] label,
.dwm-step[data-step="5"] strong {
    color: #111827 !important;
}

/* Price Box */
.dwm-price-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #93c5fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.dwm-price-box h3,
.dwm-price-box p,
.dwm-price-box td,
.dwm-price-box span,
.dwm-price-box strong {
    color: #111827 !important;
}

.dwm-price-breakdown {
    margin-top: 16px;
}

.dwm-price-table {
    width: 100%;
    border-collapse: collapse;
}

.dwm-price-table td {
    padding: 8px 0;
    font-size: 14px;
    color: #111827 !important;
}

.dwm-price-table td span,
.dwm-price-table td strong {
    color: #111827 !important;
}

.dwm-price-value {
    text-align: right;
    font-weight: 600;
}

.dwm-subtotal-row td {
    padding-top: 12px;
    border-top: 1px solid #bfdbfe;
    font-size: 15px;
}

.dwm-total-row td {
    padding-top: 12px;
    border-top: 2px solid #3b82f6;
    font-size: 18px;
    color: #1e40af !important;
    font-weight: 700;
}

.dwm-total-row td strong {
    color: #1e40af !important;
}

/* File Preview */
.dwm-file-preview {
    margin-top: 12px;
}

.dwm-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
}

.dwm-file-name {
    flex: 1;
    font-size: 13px;
    color: #111827;
}

.dwm-file-size {
    font-size: 12px;
    color: #6b7280;
}

.dwm-file-remove {
    padding: 4px 8px;
    font-size: 14px;
    font-weight: bold;
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.dwm-file-remove:hover {
    background: #fee2e2;
}

/* Responsive */
@media (max-width: 768px) {
    .dwm-container {
        padding: 16px 12px;
    }
    
    .dwm-form-wrapper {
        border-radius: 16px;
    }
    
    .dwm-form-header {
        padding: 24px 20px;
    }
    
    .dwm-form-header h2 {
        font-size: 24px;
    }
    
    .dwm-form {
        padding: 24px 20px;
    }
    
    .dwm-progress {
        padding: 16px;
        overflow-x: auto;
    }
    
    .dwm-step-label {
        font-size: 11px;
    }
    
    .dwm-grid-2, .dwm-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .dwm-actions {
        flex-direction: column;
    }
    
    .dwm-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading */
.dwm-form.dwm-loading {
    pointer-events: none;
    opacity: 0.6;
}

.dwm-form.dwm-loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 4px solid #e5e7eb;
    border-top-color: #5b6fd8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
