/* Modal styles */
.referral-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw; /* Use viewport width */
    max-width: 100vw;
    height: 100vh; /* Use viewport height */
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto; /* Allow scrolling if content is too tall */
}

/* Modal content - centered with max-width */
.referral-modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* Center vertically and horizontally */
    padding: 20px;
    border: 1px solid #888;
    width: 90%; /* Responsive width */
    max-width: 500px; /* Maximum width */
    border-radius: 5px;
    position: relative; /* For close button positioning */
}

/* Close button */
.close-modal {
    color: #aaa;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .referral-modal-content {
        margin: 30% auto; /* More top margin on mobile */
        width: 95%; /* More width on small screens */
    }
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

/* Button styles */
.referral-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.referral-button:hover {
    background-color: #45a049;
}

/* Form styles */
#referral-email {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
}

#generate-referral {
    background-color: #2196F3;
    color: white;
    padding: 0px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#generate-referral:hover {
    background-color: #0b7dda;
}

#referral-result {
    margin-top: 15px;
    padding: 10px;
    word-break: break-all;
}

/* Alert messages */
.referral-alert {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.referral-alert.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.referral-alert.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Referral link box */
.referral-link {
    display: flex;
    margin-top: 10px;
}

.referral-link input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.copy-btn {
    padding: 8px 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.copy-btn:hover {
    background: #0b7dda;
}

/* Modern Modal Styles */
.referral-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);
}

.referral-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalopen 0.4s;
}

@keyframes modalopen {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.modern-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.modern-input:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.modern-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.modern-button:hover {
    background-color: #3a7bc8;
}

/* Result Container Styles */
.referral-result-container {
    margin-top: 20px;
    animation: fadeIn 0.5s;
}

.success-message {
    color: #4CAF50;
    font-weight: 500;
    margin-bottom: 10px;
}

.link-container {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.link-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 16px;
    background: #f9f9f9;
    color: #333;
}

.copy-button {
    background: #f0f0f0;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.copy-button:hover {
    background: #e0e0e0;
}

.copy-button svg {
    color: #666;
}

/* Tooltip */
.copy-button[data-tooltip] {
    position: relative;
}

.copy-button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.copy-button[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* Add these new styles to your existing CSS */

/* Copy button success state */
.copy-button.copied {
    background-color: #4CAF50 !important;
}

.copy-button.copied svg {
    color: white !important;
}

.copy-button[data-tooltip].copied::after {
    content: 'Copied!' !important;
    background-color: #4CAF50 !important;
}

/* Generate Again button */
.generate-again-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #cbdfe7;
    color: #555;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.generate-again-button:hover {
    background-color: #e0e0e0;
}

.generate-again-button svg {
    transition: transform 0.3s;
}

.generate-again-button:hover svg {
    transform: rotate(90deg);
}

/* Copy button success state */
.copy-button.copied {
    background-color: #4CAF50 !important;
}

.copy-button.copied svg {
    color: white !important;
}

.copy-button[data-tooltip].copied::after {
    content: 'Copied!' !important;
    background-color: #4CAF50 !important;
}

.input-group-div {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

/* new */
.referral-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
     display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Arial', sans-serif;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.referral-modal-content {
    background: #fff;
    width: 900px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 0;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
    z-index: 10;
}

.close-btn:hover {
    color: #333;
}

/* Left Image Section */
.modal-left {
    flex: 1 1 50%;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modal-left img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Right Content Section */
.modal-right {
    flex: 1 1 60%;
    background: #ffffff;
    color: white;
    padding: 40px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.modal-right h2 {
    font-weight: 700;
    font-size: 36px;
    margin: 0 0 10px 0;
    color: #0c5373; /* dark teal */
}

.modal-right .subtitle {
    font-size: 20px;
    color: #107797;
    text-align: center;
}

.modal-right .step {
    font-size: 16px;
    color: #107797;
    text-align: center;
}

/* Form */
.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.input-row input[type="email"] {
    flex-grow: 1;
    padding: 12px 14px;
    border: 1.5px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-row input[type="email"]:focus {
    border-color: #0c5373;
}

.enter-btn {
    background-color: #58b1a9;
    border: none;
    padding: 0 25px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.enter-btn:hover {
    background-color: #4a8d85;
}

/* Checkbox */
.checkbox-row {
    font-size: 14px;
    margin-bottom: 20px;
    user-select: none;
    color: #a6d1d0;
}

.checkbox-row input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
    vertical-align: middle;
}

/* Social Buttons */
.social-btn {
    width: 100%;
    padding: 12px 0;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.02em;
    user-select: none;
    transition: background-color 0.3s ease;
}

.social-btn .icon {
    font-size: 18px;
    font-weight: 700;
}

/* Email Button */
.email-btn {
    background-color: #0c5373;
    color: white;
}

.email-btn:hover {
    background-color: #094255;
}

/* Facebook Button */
.facebook-btn {
    background-color: #004f7a;
    color: white;
}

.facebook-btn:hover {
    background-color: #003558;
}

/* Footer links */
.footer-links {
    margin-top: auto;
    font-size: 12px;
    color: #a6d1d0;
    text-align: center;
    padding-top: 15px;
    user-select: none;
}

.footer-links a {
    color: #a6d1d0;
    text-decoration: none;
    margin: 0 6px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 750px) {
    .referral-modal-content {
        flex-direction: column;
        width: 90vw;
    }

    .modal-left,
    .modal-right {
        flex: unset;
        width: 100%;
    }

    .modal-left {
        max-height: 220px;
    }

    .modal-left img {
        height: 100%;
        object-fit: contain;
    }

    .input-row {
        flex-direction: column;
    }

    .input-row button {
        width: 100%;
    }
}

