/**
 * PrintNotch Login Modal Styles
 * Light theme for WordPress integration
 */

/* Modal Overlay */
.pn-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pn-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.pn-modal-container {
    position: relative;
    width: 90%;
    max-width: 460px;
    height: 90%;
    max-height: 650px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

/* Close Button */
.pn-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pn-modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Login iframe */
#pn-login-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Login Trigger Button (default styling) */
.pn-login-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #21808d 0%, #1a6670 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pn-login-trigger:hover {
    background: linear-gradient(135deg, #2a9aa8 0%, #21808d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 128, 141, 0.3);
}

.pn-login-trigger:active {
    transform: translateY(0);
}

/* Account Link (when logged in) */
.pn-account-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: #21808d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.pn-account-link:hover {
    text-decoration: underline;
}

/* Loading State */
.pn-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #21808d;
    font-size: 16px;
}

.pn-modal-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #21808d;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pn-spin 0.8s linear infinite;
}

@keyframes pn-spin {
    to { transform: rotate(360deg); }
}

/* Header Account Styles */
.custom-header-account-wrapper {
    position: relative;
    display: inline-block;
}

.custom-header-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.custom-header-account .account-greeting {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* Account Dropdown Menu */
.pn-account-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 8px;
    padding: 8px 0;
}

.custom-header-account-wrapper:hover .pn-account-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pn-account-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease;
}

.pn-account-dropdown a:hover {
    background: #f5f5f5;
}

.pn-account-dropdown a.pn-logout-link {
    color: #dc3545;
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 12px;
}

.pn-account-dropdown a.pn-logout-link:hover {
    background: #fff5f5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hide greeting text on mobile - just show icon */
    .custom-header-account .account-greeting {
        display: none;
    }

    .pn-account-dropdown {
        min-width: 140px;
    }
}


@media (max-width: 480px) {
    .pn-modal-container {
        width: 95%;
        height: 95%;
        max-height: none;
        border-radius: 8px;
    }

    .pn-modal-close {
        top: 5px;
        right: 5px;
    }
}
