/* ===== Registration Modal System ===== */

/* Modal Overlay */
.registration-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #f8f9fa, #fff5e6, #ffe8cc, #f0f0f0);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.registration-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Magical floating particles */
.registration-modal-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.magic-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 204, 0, 0.6);
    border-radius: 50%;
    animation: float-magic 8s infinite linear;
}

.particle:nth-child(1) {
    width: 6px;
    height: 6px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    width: 4px;
    height: 4px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.particle:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 70%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.particle:nth-child(4) {
    width: 5px;
    height: 5px;
    left: 80%;
    animation-delay: 1s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    width: 7px;
    height: 7px;
    left: 50%;
    animation-delay: 3s;
    animation-duration: 11s;
}

.particle:nth-child(6) {
    width: 4px;
    height: 4px;
    left: 90%;
    animation-delay: 5s;
    animation-duration: 7s;
}

@keyframes float-magic {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Modal Container */
.registration-modal {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.registration-modal-overlay.active .registration-modal {
    transform: scale(1);
}

/* Modal Header */
.modal-header {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    text-align: center;
}

.modal-header h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, #FF9500, #FFCC00, #FF6B35);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    animation: titleShine 3s ease-in-out infinite;
}

@keyframes titleShine {
    0%, 100% {
        filter: drop-shadow(0 2px 8px rgba(255, 204, 0, 0.3));
    }
    50% {
        filter: drop-shadow(0 4px 12px rgba(255, 204, 0, 0.6));
    }
}

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

.modal-close:hover {
    background: #FFCC00;
    color: white;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 30px;
}

/* Service Selection View */
.service-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.service-option {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.service-option:hover::before {
    left: 100%;
}

.service-option:hover {
    border-color: #FFCC00;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 204, 0, 0.2);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #FFCC00;
    transition: transform 0.3s ease;
}

.service-option:hover .service-icon {
    transform: scale(1.1);
}

.service-option h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 10px;
}

.service-option p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Other Services Grid */
.other-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.other-service-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.other-service-card:hover {
    border-color: #FFCC00;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 204, 0, 0.15);
}

.other-service-card .service-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #FF9500;
}

.other-service-card h4 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.other-service-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Back Button - Enhanced Style */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #FFCC00, #FF9500);
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Back button in other services view - at bottom */
#otherServicesView .back-button {
    margin-top: 10px;
}

/* Back button in form views - at top */
.service-form ~ .back-button,
#cvServiceView .back-button,
#bewerbungServiceView .back-button,
#translationServiceView .back-button {
    margin-bottom: 25px;
    align-self: flex-start;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.back-button:hover::before {
    left: 100%;
}

.back-button:hover {
    background: linear-gradient(135deg, #FF9500, #FFCC00);
    transform: translateX(-5px) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.5);
}

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

.back-button:hover i {
    transform: translateX(-4px);
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(-4px); }
    50% { transform: translateX(-8px); }
}

/* Form Styles */
.service-form {
    max-width: 600px;
    margin: 0 auto;
}

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

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

.form-group label i {
    color: #FFCC00;
    margin-right: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FFCC00;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

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

.form-group input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #FFCC00, #FF9500);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.form-group input[type="file"]::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.3);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #FFCC00, #FF9500);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 204, 0, 0.6);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success/Error Messages */
.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
}

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

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

.form-message.show {
    display: block;
    animation: slideInUp 0.3s ease;
}

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

/* View States */
.modal-view {
    display: none !important;
}

.modal-view.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

/* Ensure other services view is hidden by default */
#otherServicesView {
    display: none !important;
}

#otherServicesView.active {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .registration-modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
        padding-right: 40px;
    }

    .modal-body {
        padding: 20px;
    }

    .service-selection {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .service-option {
        padding: 30px 20px;
    }

    .service-icon {
        font-size: 2.5rem;
    }

    .other-services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .submit-btn {
        font-size: 1rem;
        padding: 12px;
    }

    .back-button {
        width: 100%;
        justify-content: center;
    }

    #otherServicesView .back-button {
        margin-top: 20px;
    }
}

/* Smooth Scrollbar */
.registration-modal::-webkit-scrollbar {
    width: 8px;
}

.registration-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.registration-modal::-webkit-scrollbar-thumb {
    background: #FFCC00;
    border-radius: 10px;
}

.registration-modal::-webkit-scrollbar-thumb:hover {
    background: #FF9500;
}

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

.submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 10px;
}

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