/* About Modal */
.about-modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    backdrop-filter: blur(4px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.about-modal {
    background: var(--color-bg-surface);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px var(--color-shadow-xl);
    animation: userMenuIn 0.25s ease-out;
}

.about-modal-logo {
    width: 72px;
    height: 72px;
    background: var(--color-accent-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px var(--color-accent-shadow);
}

.about-modal-logo i {
    font-size: 32px;
    color: var(--color-danger-text);
}

.about-modal h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 6px;
}

.about-modal .about-version {
    font-size: 13px;
    color: var(--color-text-faint);
    margin-bottom: 20px;
}

.about-modal .about-description {
    font-size: 14px;
    color: var(--color-text-subtle);
    line-height: 1.6;
    margin-bottom: 24px;
}

.about-modal .about-tech {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.about-modal .about-tech-badge {
    padding: 4px 12px;
    background: var(--color-bg-hover);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-text-subtle);
    font-weight: 500;
}

.about-modal .about-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.about-modal .about-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.about-modal .about-link:hover {
    opacity: 0.8;
}

.about-modal .about-close-btn {
    padding: 10px 32px;
    background: var(--color-accent-gradient);
    color: var(--color-danger-text);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    box-shadow: 0 4px 15px var(--color-accent-shadow);
}

.about-modal .about-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--color-accent-shadow-lg);
}

/* Modern Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.modal-container {
    background-color: var(--color-bg-surface);
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 60px var(--color-shadow-3xl);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.modal-icon {
    width: 44px;
    height: 44px;
    background: var(--color-accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;

    [dir="rtl"] & {
        margin-left: 14px;
        margin-right: unset;
    }
}

.modal-icon i {
    color: var(--color-danger-text);
    font-size: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-heading);
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-bg-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
    transition: all 0.15s ease;

    [dir="rtl"] & {
        left: 16px;
        right: unset;
    }
}

.modal-close-btn:hover {
    background: var(--color-border);
    color: var(--color-text-heading);
}

.modal-body {
    padding: 24px;
}

.modal-body label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg-hover);
    color: var(--color-text-heading);
    transition: all 0.15s ease;
    outline: none;
}

.modal-input:focus {
    border-color: var(--color-accent);
    background: var(--color-bg-surface);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.modal-input::placeholder {
    color: var(--color-text-placeholder);
}

.modal-input--error {
    border-color: var(--color-error-text);
}

.modal-error {
    margin-top: 8px;
    font-size: 13px;
    color: var(--color-error-text);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--color-bg-hover);
    border-top: 1px solid var(--color-border);
}

.modal-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-footer .btn-secondary {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.modal-footer .btn-secondary:hover {
    background: var(--color-bg-muted);
    border-color: var(--color-border-medium);
}

.modal-footer .btn-primary {
    background: var(--color-accent-gradient);
    border: none;
    color: var(--color-danger-text);
    box-shadow: 0 2px 8px var(--color-accent-shadow);
}

.modal-footer .btn-primary:hover {
    box-shadow: 0 4px 12px var(--color-accent-shadow-lg);
    transform: translateY(-1px);
}

.modal-footer .btn-primary:active {
    transform: translateY(0);
}

/* ── Panel mode (ShareModal, etc.) ─────────────────────────────────────────── */
/* Wider, taller container; body becomes a zero-padding scrollable slot.       */

.modal-container--panel {
    width: 520px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-container--panel .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
