/**
 * Route Password Frontend Styling
 *
 * Styles for password-protected routes on the frontend:
 * - Lock icons and indicators
 * - Blur effects for maps and content
 * - Inline password forms
 * - Single route modal
 * - Global unlock box
 *
 * @package RouteFinder
 * @since 2.0.0
 */

/* ==========================================
 * ROUTE CARD PROTECTION
 * ========================================== */

.rfcc-route-card.rfcc-locked {
    position: relative;
}

.rfcc-route-card.rfcc-locked .rfcc-map-blur {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    transition: filter 0.3s ease;
}

.rfcc-map-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.rfcc-map-blur-overlay .fa {
    font-size: 48px;
    color: #fff;
    opacity: 0.9;
}

.rfcc-route-card.rfcc-locked .rfcc-hidden-description {
    display: none;
}

.rfcc-route-card.rfcc-locked .rfcc-description-placeholder {
    font-style: italic;
    color: #666;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* ==========================================
 * INLINE PASSWORD ENTRY WITHIN BUTTON
 * ========================================== */

.view-route-button.rfcc-unlock-route-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: auto;
    min-width: 0;
    position: relative;
    border: none !important;
    background: var(--rfcc-lock-button-color, var(--rfcc-button-color, #0c55cc)) !important;
    color: #fff !important;
    box-shadow: none;
}

.view-route-button.rfcc-unlock-route-btn:focus {
    outline: none;
}

.view-route-button.rfcc-unlock-route-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

.view-route-button.rfcc-unlock-route-btn .fa-lock {
    margin-right: 6px;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-input-group {
    display: none;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 4px;
    background: #fff;
    padding: 4px 6px;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    flex: 1 1 auto;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-input-group[hidden] {
    display: none !important;
}

.view-route-button.rfcc-unlock-route-btn.rfcc-show-password {
    padding: 6px 8px;
    justify-content: flex-start;
}

.view-route-button.rfcc-unlock-route-btn.rfcc-show-password .rfcc-button-text {
    display: none;
}

.view-route-button.rfcc-unlock-route-btn.rfcc-show-password .rfcc-password-input-group {
    display: inline-flex;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-input-group input[type="password"] {
    flex: 1 1 120px;
    min-width: 0;
    border: none;
    padding: 6px 8px;
    font-size: 14px;
    background: transparent;
    color: #333;
    box-sizing: border-box;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-input-group input[type="password"]:focus {
    outline: none;
    box-shadow: none;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 3px;
    background: var(--rfcc-lock-button-color, var(--rfcc-button-color, #0c55cc));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-submit:hover {
    opacity: 0.9;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-submit:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.35);
    outline-offset: 2px;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-submit.is-loading,
.view-route-button.rfcc-unlock-route-btn .rfcc-password-submit[aria-disabled="true"] {
    opacity: 0.6;
    cursor: wait;
}

.view-route-button.rfcc-unlock-route-btn .rfcc-password-error {
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
    font-size: 13px;
    color: #dc3232;
    text-align: center;
}

.view-route-button.rfcc-unlock-route-btn.rfcc-show-password .rfcc-password-error {
    display: block;
}

/* ==========================================
 * GLOBAL PASSWORD UNLOCK BOX
 * ========================================== */

.rfcc-global-password-box {
    background: #fffbcc;
    border: 2px solid #ffb900;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.rfcc-global-password-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rfcc-global-password-box h3 .fa {
    font-size: 20px;
    color: #ffb900;
}

.rfcc-global-password-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.rfcc-global-password-input-wrapper {
    flex: 1;
    min-width: 250px;
}

.rfcc-global-password-input-wrapper label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.rfcc-global-password-input-wrapper input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.rfcc-global-password-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    background: var(--rfcc-button-color, #0c55cc);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.rfcc-global-password-submit:hover {
    opacity: 0.9;
}

.rfcc-global-password-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.rfcc-password-error {
    color: #dc3232;
    font-size: 13px;
    margin-top: 6px;
    padding: 8px 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
}

/* ==========================================
 * SINGLE ROUTE MODAL
 * ========================================== */

.rfcc-single-route-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.rfcc-single-route-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 26, 0.85);
}

.rfcc-single-route-modal-content {
    position: relative;
    z-index: 2;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.rfcc-single-route-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.rfcc-single-route-modal-title {
    font-size: 22px;
    margin-bottom: 12px;
}

.rfcc-single-route-modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rfcc-single-route-modal-form input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.rfcc-single-route-modal-form button[type="submit"] {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    background: var(--rfcc-button-color, #0c55cc);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.rfcc-single-route-modal-form button[type="submit"]:hover {
    opacity: 0.9;
}

.rfcc-single-route-modal-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: wait;
}

.rfcc-single-route-modal-error {
    color: #dc3232;
    font-size: 14px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
    padding: 8px 10px;
}

@media (max-width: 480px) {
    .view-route-button.rfcc-unlock-route-btn {
        width: 100%;
    }

    .view-route-button.rfcc-unlock-route-btn .rfcc-password-input-group {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .view-route-button.rfcc-unlock-route-btn .rfcc-password-submit {
        width: 100%;
    }
}
