* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #621E4A;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.container {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.sparkle {
    position: absolute;
    top: 50px;
    right: 50px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #fff, transparent);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.form-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.title {
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.greeting-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    transition: all 0.3s ease;
    color: #333;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #fff;
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.5);
}

/* Song Select Group */
.song-select-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.song-select-group select {
    flex: 1;
}

/* Demo Button Styles */
.demo-btn {
    padding: 15px 20px;
    border: 2px solid #ffd700;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.demo-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.demo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.demo-btn.playing {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border-color: #ff6b6b;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .song-select-group {
        flex-direction: column;
    }
    
    .demo-btn {
        width: 100%;
        min-width: auto;
    }
}

.form-group input::placeholder {
    color: #666;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #ffd700;
}

.terms-link {
    color: #ffd700;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.terms-link:hover {
    color: #ffed4e;
    text-decoration: none;
}

.submit-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #621E4A;
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 30px;
    font-size: 24px;
}

.close-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .form-wrapper {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .sparkle {
        top: 20px;
        right: 20px;
        width: 20px;
        height: 20px;
    }
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.submit-btn.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Form Processing State */
.form-processing {
    position: relative;
}

.form-processing::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    border-radius: 20px;
    z-index: 10;
}

.form-processing::after {
    content: "מעבד נתונים...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-processing .form-wrapper {
    opacity: 0.3;
    pointer-events: none;
}

/* Loading Spinner for Form Processing */
.processing-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 12;
    display: none;
}

.form-processing .processing-spinner {
    display: block;
}

.processing-spinner::before {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    display: block;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}