/* Rohtec Form Styles */

.rohtec-form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rohtec-form-title {
    text-align: center;
    color: #003366;
    margin-bottom: 30px;
    font-size: 28px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #003366;
    font-size: 20px;
    border-bottom: 2px solid #003366;
    padding-bottom: 5px;
}

.form-section h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #555;
    font-size: 16px;
}

/* Form Row and Groups */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76,175,80,0.3);
}

/* Checkbox and Radio Groups */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    margin-right: 5px;
}

/* Inline Form Elements */
.form-group.inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group.inline label {
    margin-bottom: 0;
    margin-right: 10px;
}

/* Dämmschicht Special Styling */
.daemmschicht-group .form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.daemmschicht-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    min-width: 150px;
}

/* Article Table */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.article-table th,
.article-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.article-table th {
    background-color: #003366;
    color: white;
    font-weight: 600;
}

.article-table input[type="text"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.article-table input[type="checkbox"] {
    cursor: pointer;
}

.remove-row {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

.remove-row:hover {
    background: #c82333;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

#add-article-row {
    margin-top: 10px;
}

/* Submit Section */
.submit-section {
    text-align: center;
    margin-top: 30px;
}

/* Form Message */
.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Print Styles */
@media print {
    .rohtec-form-container {
        box-shadow: none;
        padding: 0;
    }
    
    .form-section {
        page-break-inside: avoid;
        border: 1px solid #000;
    }
    
    .btn-primary,
    .btn-secondary,
    .remove-row,
    #add-article-row {
        display: none;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        border: 1px solid #000;
        background: transparent;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .checkbox-group,
    .radio-group {
        flex-direction: column;
    }
    
    .article-table {
        font-size: 12px;
    }
    
    .article-table th,
    .article-table td {
        padding: 5px;
    }
}

/* Online/Offline Indicator */
.online-indicator {
    position: absolute;
    top: -30px;
    right: 0;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.online-indicator.online {
    background: #4CAF50;
    color: white;
}

.online-indicator.offline {
    background: #f44336;
    color: white;
}

/* Draft saved indicator */
.draft-saved-indicator {
    position: absolute;
    top: -25px;
    left: 0;
    background: #2196F3;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 11px;
}

/* Warning message style */
.form-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Offline mode visual indicator */
.rohtec-form-container.offline-mode {
    border: 2px solid #f44336;
}

.rohtec-form-container.offline-mode::before {
    content: "OFFLINE MODUS";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #f44336;
    color: white;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: bold;
}

/* PWA install button */
.pwa-install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: none;
    z-index: 9999;
}

.pwa-install-button:hover {
    background: #1976D2;
}

@media (max-width: 768px) {
    .online-indicator {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 10px;
        display: inline-block;
    }
}

/* Header Section Special Styling */
.header-section {
    background: #e8f4f8;
    border: 2px solid #003366;
}

.header-section .form-row:first-child {
    border-bottom: 1px solid #ccc;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

/* Rohtec Brand Colors */
.rohtec-form-container::before {
    content: "ROHTEC";
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #003366;
    letter-spacing: 2px;
}

/* Additional Hover Effects */
input[type="checkbox"]:hover,
input[type="radio"]:hover {
    cursor: pointer;
    transform: scale(1.1);
}

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

.rohtec-form.loading::after {
    content: "Wird gespeichert...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 5px;
    font-size: 18px;
}
