/* Modal Base */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    margin: 50vh auto;
    padding: 2rem;
    background: #1a1a1a;
    border-radius: 12px;
    color: #fff;
    transform: translateY(-50%) scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(-50%) scale(1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    color: #fff;
}

.modal-subtitle {
    color: #999;
    margin: 0;
    font-size: 1rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.input-wrapper {
    position: relative;
    overflow: visible;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-wrapper input,
.input-wrapper textarea,
.input-wrapper .select-box {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    height: 48px;
}

.input-wrapper textarea {
    min-height: 120px;
    height: auto;
    resize: none;
    line-height: 1.5;
    padding-top: 1rem;
}

.input-wrapper textarea::-webkit-scrollbar {
    width: 8px;
}

.input-wrapper textarea::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.input-wrapper textarea::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.input-wrapper textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.input-wrapper textarea {
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 1;
}

.input-wrapper textarea ~ .input-icon {
    top: 1.25rem;
    transform: none;
}

.input-wrapper input:hover,
.input-wrapper textarea:hover,
.input-wrapper .select-box:hover {
    border-color: #444;
    background: #2d2d2d;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus,
.input-wrapper .select-box:focus {
    outline: none;
    border-color: #3498db;
    background: #2f2f2f;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder,
.input-wrapper .select-box .selected-option {
    color: #666;
    transition: color 0.3s ease;
}

.custom-select {
    position: relative;
    width: 100%;
}

.select-box {
    position: relative;
    width: 100%;
    padding: 0.875rem 2.5rem;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #666;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    height: 48px;
    box-sizing: border-box;
}

.select-box:hover {
    border-color: #444;
    background: #2d2d2d;
}

.custom-select.open .select-box {
    border-radius: 8px 8px 0 0;
    border-color: #3498db;
}

.arrow-icon {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    color: #666;
    pointer-events: none;
}

.custom-select.open .arrow-icon {
    transform: translateY(-50%) rotate(180deg);
    color: #3498db;
}

.custom-select .select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 5px;
    padding: 0;
    list-style: none;
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.custom-select .select-options li {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.custom-select .select-options li:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.custom-select.open .select-options {
    display: block;
}

/* Light Mode Anpassungen */
[data-theme="light"] .custom-select .select-options {
    background: white;
    border-color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .custom-select .select-options li {
    color: #333;
}

[data-theme="light"] .custom-select .select-options li:hover {
    background-color: #f5f5f5;
}

.custom-select.error .select-box {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.1);
}

.custom-select.error .selected-option {
    color: #e74c3c;
}

.custom-select.error .error-message {
    display: block;
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Error States */
.form-group .error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

.form-group.error .input-wrapper input,
.form-group.error .input-wrapper textarea {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.form-group.error .custom-select .select-box {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.form-group.error .selected-option {
    color: #e74c3c;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error .select-box {
    border-color: rgba(255, 59, 48, 0.5);
    background: rgba(255, 59, 48, 0.05);
}

.form-group.error input:focus,
.form-group.error textarea:focus,
.form-group.error .select-box:focus {
    border-color: #ff3b30;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.error-message {
    color: #ff3b30;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-group.error .error-message {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: #3498db;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.submit-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.submit-btn:hover::before {
    transform: translateX(100%);
}

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

.submit-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover i {
    transform: translateX(3px);
}

/* Loading State */
.submit-btn.loading {
    background: #2980b9;
    pointer-events: none;
}

.submit-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Checkbox Styles */
.checkbox-group {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.checkbox-group.error {
    background: rgba(255, 59, 48, 0.1);
    border-color: #ff3b30;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.checkbox-wrapper input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid #666;
    border-radius: 6px;
    margin: 0;
    cursor: pointer;
    position: relative;
    background: transparent;
    flex-shrink: 0;
    margin-top: 0;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: #3498db;
    border-color: #3498db;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
}

.checkbox-wrapper label {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.checkbox-wrapper label a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.checkbox-wrapper label a:hover {
    color: var(--accent-color-dark);
    text-decoration: underline;
}

.checkbox-wrapper label a:focus {
    color: var(--accent-color-dark);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Light Mode Anpassungen */
[data-theme="light"] .checkbox-wrapper label {
    color: #333;
}

[data-theme="light"] .checkbox-wrapper label a {
    color: var(--accent-color);
}

[data-theme="light"] .checkbox-wrapper label a:hover {
    color: var(--accent-color-dark);
}

[data-theme="light"] .checkbox-wrapper label a:focus {
    color: var(--accent-color-dark);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Dark Mode Anpassungen */
[data-theme="dark"] .checkbox-wrapper label {
    color: #fff;
}

[data-theme="dark"] .checkbox-wrapper label a {
    color: var(--accent-color-light, #4dd0e1);
}

[data-theme="dark"] .checkbox-wrapper label a:hover,
[data-theme="dark"] .checkbox-wrapper label a:focus {
    color: var(--accent-color-light, #4dd0e1);
}

.checkbox-group .error-message {
    margin-left: calc(22px + 0.75rem);
    margin-top: 0.5rem;
}

/* Success Message */
.success-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-message[style*="display: block"] {
    opacity: 1;
}

.success-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    margin: 50vh auto;
    padding: 2rem;
    background: #1a1a1a;
    border-radius: 12px;
    color: #fff;
    text-align: center;
    transform: translateY(-50%) scale(0.9);
    transition: transform 0.3s ease;
}

.success-message[style*="display: block"] .success-content {
    transform: translateY(-50%) scale(1);
}

.success-content i {
    font-size: 3rem;
    color: #00a6fb;
    margin-bottom: 1rem;
}

.success-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.success-content p {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.close-success {
    background: #00a6fb;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-success:hover {
    background: #0084c8;
}

@media (max-width: 768px) {
    .success-content {
        width: 95%;
        margin: 40vh auto;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: none;
        margin: 20px;
        padding: 20px;
    }

    .contact-form-header {
        margin-bottom: 20px;
    }

    .contact-form-header h2 {
        font-size: 1.6rem;
    }

    .contact-form-header p {
        font-size: 0.95rem;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-label {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }

    .form-input,
    .form-textarea {
        padding: 10px;
        font-size: 0.95rem;
    }

    .form-textarea {
        min-height: 100px;
    }

    .contact-form-footer {
        flex-direction: column;
        gap: 15px;
    }

    .form-button {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    .contact-info-modal {
        margin-top: 20px;
        padding: 15px;
    }

    .contact-info-item {
        margin-bottom: 12px;
    }

    .contact-info-item i {
        font-size: 1.2rem;
        margin-right: 8px;
    }

    .contact-info-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 15px;
        padding: 15px;
    }

    .contact-form-header h2 {
        font-size: 1.4rem;
    }

    .contact-form-header p {
        font-size: 0.9rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-input,
    .form-textarea {
        padding: 8px;
        font-size: 0.9rem;
    }

    .form-button {
        padding: 10px;
        font-size: 0.95rem;
    }

    .contact-info-item i {
        font-size: 1.1rem;
    }

    .contact-info-text {
        font-size: 0.9rem;
    }

    .close-button {
        top: 10px;
        right: 10px;
        font-size: 1.2rem;
    }
}

/* Light Mode Styles */
[data-theme="light"] .modal-content {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: none !important;
}

[data-theme="light"] .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .modal-header h2,
[data-theme="light"] .modal-subtitle {
    color: #333333 !important;
}

[data-theme="light"] .input-wrapper input,
[data-theme="light"] .input-wrapper textarea,
[data-theme="light"] .input-wrapper .select-box,
[data-theme="light"] .custom-select .select-box {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    color: #333333 !important;
}

[data-theme="light"] .input-wrapper input:hover,
[data-theme="light"] .input-wrapper textarea:hover,
[data-theme="light"] .input-wrapper .select-box:hover,
[data-theme="light"] .custom-select .select-box:hover {
    border-color: #cccccc !important;
    background: #ffffff !important;
}

[data-theme="light"] .input-wrapper input:focus,
[data-theme="light"] .input-wrapper textarea:focus,
[data-theme="light"] .input-wrapper .select-box:focus,
[data-theme="light"] .custom-select.open .select-box {
    border-color: #3498db !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

[data-theme="light"] .form-group.error input,
[data-theme="light"] .form-group.error textarea,
[data-theme="light"] .form-group.error .select-box {
    border-color: #ff4d4d !important;
    background: #ffffff !important;
}

[data-theme="light"] .error-message {
    color: #ff4d4d !important;
    font-size: 0.85rem !important;
    margin-top: 4px !important;
}

[data-theme="light"] .input-icon {
    color: #999999 !important;
}

[data-theme="light"] .form-group.error .input-icon {
    color: #ff4d4d !important;
}

[data-theme="light"] .input-wrapper input::placeholder,
[data-theme="light"] .input-wrapper textarea::placeholder,
[data-theme="light"] .input-wrapper .select-box .selected-option {
    color: #999999 !important;
}

/* Dropdown Basis-Styles */
select {
    background-color: var(--background-dark) !important;
    color: var(--text-color) !important;
}

select option {
    background-color: var(--background-dark) !important;
    color: var(--text-color) !important;
}

/* Light Mode Overrides */
[data-theme="light"] select {
    background-color: white !important;
    color: #333 !important;
}

[data-theme="light"] select option {
    background-color: white !important;
    color: #333 !important;
}

/* Spezifische Styles für das Kontaktformular */
.contact-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* Placeholder */
.contact-form select option[value=""] {
    color: var(--text-muted) !important;
}

[data-theme="light"] .contact-form select option[value=""] {
    color: #999 !important;
}

/* Firefox-spezifische Styles */
@-moz-document url-prefix() {
    [data-theme="light"] select,
    [data-theme="light"] select option {
        background-color: white !important;
        color: #333 !important;
    }
    
    select,
    select option {
        background-color: var(--background-dark) !important;
        color: var(--text-color) !important;
    }
}

/* Webkit-spezifische Styles */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    [data-theme="light"] select,
    [data-theme="light"] select option {
        background-color: white !important;
        color: #333 !important;
    }
    
    select,
    select option {
        background-color: var(--background-dark) !important;
        color: var(--text-color) !important;
    }
}
