/* Login/Registration Modal Styles */
body.modal-open {
    overflow: hidden;
}

.login-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

.auth-tabs {
    display: flex !important;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    position: relative !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    background-color: #f8f9fa;
    border: none;
    cursor: pointer !important;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #6c757d;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1000 !important;
}

.auth-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.auth-tab:hover:not(.active) {
    background-color: #e9ecef;
    cursor: pointer !important;
}

/* Ensure only one form is visible at a time - MAIN CONTROL */
.auth-form {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

.auth-form.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
    left: auto !important;
}

/* Additional safety rules */
#login-form:not(.active),
#register-form:not(.active) {
    display: none !important;
}

#login-form.active,
#register-form.active {
    display: block !important;
}

/* Hide any stray images that might appear */
.modal-body img,
.auth-form img,
.login-modal img {
    display: none !important;
}

/* Ensure clean form display */
.auth-form * {
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.auth-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #6c757d;
    font-size: 14px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e1e5e9;
    z-index: 1;
}

.auth-divider span {
    background-color: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

.login-prompt {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.login-prompt p {
    margin-bottom: 20px;
    color: #6c757d;
    font-size: 16px;
}

.btn-login-prompt {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-login-prompt:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

/* Loading spinner */
.auth-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 480px) {
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Welcome message styling */
.welcome-message {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Review form styling after login */
.review-form .form-group {
    margin-bottom: 15px;
}

.review-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.review-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.review-form .btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.review-form .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Star rating in review form */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    margin-right: 5px;
    transition: color 0.2s ease;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffd700;
}

/* Review display stars */
.review-rating .star {
    color: #ddd;
    font-size: 18px;
}

.review-rating .star.filled {
    color: #ffd700;
}

/* Enhanced register button functionality */
.auth-tab[data-tab="register"] {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
    position: relative !important;
    user-select: none !important;
}

.auth-tab[data-tab="register"]:hover {
    background-color: #e9ecef !important;
}

.auth-tab[data-tab="register"].active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}
