/* Stirnimann AG Contact Widget - Ersatz für Chatbot */

/* Contact Button */
#contact-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #28A745;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
    border: none;
}

#contact-widget-button:hover {
    transform: scale(1.1);
    background: #34ce57;
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.6);
}

#contact-widget-button .contact-icon {
    color: white;
    font-size: 20px;
    transition: transform 0.3s ease;
}

#contact-widget-button:hover .contact-icon {
    transform: rotate(15deg);
}

/* Contact Widget Window */
#contact-widget-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000001;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* Header */
.contact-widget-header {
    background: #2C5282;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-widget-title {
    font-weight: 600;
    font-size: 18px;
    margin: 0;
}

.contact-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.contact-widget-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Form Content */
.contact-widget-content {
    padding: 25px;
    max-height: 500px;
    overflow-y: auto;
}

.contact-intro {
    text-align: center;
    margin-bottom: 25px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Form Styling */
.contact-form-group {
    margin-bottom: 20px;
}

.contact-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.contact-form-input,
.contact-form-textarea,
.contact-form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.contact-form-input:focus,
.contact-form-textarea:focus,
.contact-form-select:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.contact-form-textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.contact-form-select {
    cursor: pointer;
    background-color: white;
}

/* Submit Button */
.contact-submit-btn {
    width: 100%;
    padding: 15px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.contact-submit-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.contact-submit-btn:active {
    transform: translateY(0);
}

.contact-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action-btn {
    padding: 12px 8px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.quick-action-btn:hover {
    background: #e9ecef;
}

/* Success/Error Messages */
.contact-widget-message {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 20px 30px;
border-radius: 12px;
font-size: 16px;
font-weight: 600;
line-height: 1.4;
text-align: center;
z-index: 10001;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
animation: popupIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
min-width: 300px;
max-width: 90vw;
}

.contact-widget-message.success {
background: #28a745;
color: white;
border: 2px solid rgba(255, 255, 255, 0.3);
}

.contact-widget-message.error {
background: #dc3545;
color: white;
border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes popupIn {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.5);
}
100% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Mobile & Tablet Responsive */
@media (max-width: 768px) {
    #contact-widget-button {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }
    
    #contact-widget-button .contact-icon {
        font-size: 22px;
    }
    
    #contact-widget-window {
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        border-radius: 16px;
    }
    
    .contact-widget-header {
        padding: 16px 20px;
    }
    
    .contact-widget-title {
        font-size: 16px;
    }
    
    .contact-widget-content {
        padding: 20px;
        max-height: 70vh;
    }
    
    .contact-intro {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .contact-form-input,
    .contact-form-textarea,
    .contact-form-select {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 12px;
    }
    
    .contact-form-textarea {
        min-height: 120px;
    }
    
    .contact-submit-btn {
        padding: 16px;
        font-size: 17px;
        border-radius: 12px;
        margin-top: 15px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .quick-action-btn {
        padding: 14px 12px;
        font-size: 15px;
        border-radius: 12px;
        min-height: 48px;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    #contact-widget-window {
        bottom: 75px;
        right: 8px;
        left: 8px;
    }
    
    .contact-widget-content {
        padding: 16px;
        max-height: 65vh;
    }
    
    .contact-widget-header {
        padding: 14px 16px;
    }
    
    .contact-form-group {
        margin-bottom: 16px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #contact-widget-window {
        max-height: 85vh;
    }
    
    .contact-widget-content {
        max-height: 60vh;
        padding: 16px 20px;
    }
    
    .contact-intro {
        margin-bottom: 16px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        margin-bottom: 20px;
    }
}

/* Popup Message Responsive */
@media (max-width: 480px) {
    .contact-widget-message {
        min-width: 280px;
        padding: 18px 24px;
        font-size: 15px;
        margin: 0 10px;
    }
}

/* Animation for widget appearance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#contact-widget-window.show {
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
