/**
 * Terminbuchung CSS für WordPress Integration
 * Professionelles Styling für das Buchungs-Tool
 */

/* Reset und Basis-Styling */
#terminbuchung-container * {
    box-sizing: border-box;
}

#terminbuchung-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 800px;
    margin: 2rem auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Styling */
.booking-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.booking-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.booking-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #64748b;
    background: transparent;
}

.step.active {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

.step.completed {
    background: #10b981;
    color: white;
}

/* Booking Content */
.booking-content {
    padding: 2rem;
}

.booking-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.booking-step.active {
    display: block;
}

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

.booking-step h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Kalender Styling */
.calendar-container {
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.calendar-nav {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.calendar-nav:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.calendar-nav:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-day-header {
    background: #475569;
    color: white;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: white;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    position: relative;
}

.calendar-day:hover:not(.disabled) {
    background: #f1f5f9;
    transform: scale(1.05);
}

.calendar-day.disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.calendar-day.selected {
    background: #3b82f6;
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.calendar-day.other-month {
    color: #cbd5e1;
    background: #f8fafc;
}

/* Zeitslots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.time-slot {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.time-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.time-slot:hover::before {
    left: 100%;
}

.time-slot:hover {
    border-color: #3b82f6;
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.time-slot.selected {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Formular Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Button Styling */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Summary Styling */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #3b82f6;
}

.summary-label {
    font-weight: 600;
    color: #374151;
}

.summary-value {
    color: #1f2937;
    font-weight: 500;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-message h3 {
    color: #10b981;
    margin-bottom: 1rem;
}

.success-message p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.info-box {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0 2rem 0;
    text-align: left;
    color: #0c4a6e;
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-box strong {
    color: #0369a1;
    display: block;
    margin-bottom: 0.5rem;
}

/* Loading States */
.loading-spinner,
.loading-message {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message,
.no-times-message {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* Responsive Design */
@media (max-width: 768px) {
    #terminbuchung-container {
        margin: 1rem;
        border-radius: 8px;
    }
    
    .booking-content {
        padding: 1.5rem;
    }
    
    .booking-header {
        padding: 1.5rem;
    }
    
    .booking-header h2 {
        font-size: 1.75rem;
    }
    
    .step {
        font-size: 0.8rem;
        padding: 0.5rem 0.25rem;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .calendar-nav {
        width: 100%;
        max-width: 200px;
    }
    
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .time-slot {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .calendar-day {
        min-height: 40px;
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }
    
    .calendar-day-header {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .booking-header h2 {
        font-size: 1.5rem;
    }
    
    .booking-content {
        padding: 1rem;
    }
    
    .time-slots {
        grid-template-columns: 1fr;
    }
    
    .step {
        font-size: 0.75rem;
        padding: 0.4rem 0.2rem;
    }
    
    .calendar-day {
        min-height: 35px;
        font-size: 0.85rem;
    }
}

/* WordPress Theme Compatibility */
.terminbuchung-tool {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 2rem 0;
}

/* Admin Styling für WordPress Backend */
.wp-admin .terminbuchung-settings {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-admin .terminbuchung-settings .card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.wp-admin .terminbuchung-settings .card h2 {
    margin-top: 0;
    color: #1e293b;
}

.wp-admin .terminbuchung-settings ol {
    line-height: 1.8;
}

.wp-admin .terminbuchung-settings code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
}