/**
 * ChatGPT Modal - Clean Rewrite
 * Simple, reliable CSS
 */

/* Modal Container */
.cg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cg-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    direction: rtl;
}

/* Close Button */
.cg-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #8351F1 !important;
    border: none;
    color: #ffffff !important;
    font-size: 24px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
    transition: background 0.15s ease;
}

.cg-modal-close:hover {
    background: #6d3fd3 !important;
    color: #ffffff !important;
}

.cg-modal-close:active {
    background: #5a2fb8 !important;
    color: #ffffff !important;
}

/* Header */
.cg-modal-header {
    padding: 40px 32px 24px;
    text-align: center;
}

.cg-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin: 0 0 8px;
}

.cg-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Body */
.cg-modal-body {
    padding: 0 32px 24px;
}

/* Social Buttons */
.cg-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.cg-btn-social {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: #ffffff !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #111827 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: right;
    direction: rtl;
    position: relative;
}

.cg-btn-social:hover {
    background: #f8f9ff !important;
    border-color: #8351F1 !important;
    box-shadow: 0 2px 8px rgba(131, 81, 241, 0.15);
    color: #111827 !important;
}

.cg-btn-social:active {
    background: #f0f2ff !important;
    border-color: #6d3fd3 !important;
    color: #111827 !important;
}

.cg-btn-social:focus {
    background: #f8f9ff !important;
    border-color: #8351F1 !important;
    outline: none;
    color: #111827 !important;
}

.cg-btn-social svg {
    flex-shrink: 0;
}

.cg-btn-social span {
    flex: 1;
    text-align: right;
}

/* Divider */
.cg-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #999;
    font-size: 13px;
}

.cg-divider::before,
.cg-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.cg-divider span {
    padding: 0 16px;
}

/* Email Section */
.cg-email-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cg-email-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    color: #000;
    background: #ffffff;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
}

.cg-email-input:focus {
    outline: none;
    border-color: #8351F1;
    box-shadow: 0 0 0 3px rgba(131, 81, 241, 0.1);
}

.cg-email-input::placeholder {
    color: #999;
}

.cg-btn-hide-email {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9f9f9 !important;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #666 !important;
    cursor: pointer;
    width: fit-content;
    transition: all 0.15s ease;
    direction: rtl;
}

.cg-btn-hide-email:hover {
    background: #f0f2ff !important;
    border-color: #8351F1 !important;
    color: #111827 !important;
}

.cg-btn-hide-email:active {
    background: #e8ebff !important;
    border-color: #6d3fd3 !important;
    color: #111827 !important;
}

.cg-btn-hide-email:focus {
    background: #f0f2ff !important;
    border-color: #8351F1 !important;
    outline: none;
    color: #111827 !important;
}

.cg-hide-email-desc {
    font-size: 12px;
    color: #666;
    margin: -8px 0 0;
    line-height: 1.4;
}

.cg-btn-continue {
    width: 100%;
    padding: 12px 16px;
    background: #8351F1 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-top: 8px;
    direction: rtl;
}

.cg-btn-continue:hover {
    background: #6d3fd3 !important;
    color: #ffffff !important;
}

.cg-btn-continue:active {
    background: #5a2fb8 !important;
    color: #ffffff !important;
}

.cg-btn-continue:disabled {
    background: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed;
}

/* Footer */
.cg-modal-footer {
    padding: 16px 32px 24px;
    text-align: center;
}

.cg-terms {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.cg-terms a {
    color: #8351F1;
    text-decoration: none;
}

.cg-terms a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .cg-modal-dialog {
        width: 95%;
        border-radius: 12px;
    }
    
    .cg-modal-header,
    .cg-modal-body,
    .cg-modal-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
}
