/**
 * Picks Curated Membership CSS
 * Styles for authentication modals, forms, and user dashboard
 * 
 * File: /wp-content/themes/picks-curated-theme/src/membership.css
 */

/* ==========================================
   MODAL OVERLAY
   ========================================== */

.pc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================
   MODAL CONTAINER
   ========================================== */

.pc-modal-container {
    position: relative;
    display: flex;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pc-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.pc-modal-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.pc-modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
}

/* ==========================================
   AUTH FORM
   ========================================== */

.pc-auth-form {
    flex: 1;
    padding: 2.5rem;
    max-width: 420px;
    overflow-y: auto;
}

.pc-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pc-auth-logo {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-auth-logo svg {
    width: 2rem;
    height: 2rem;
    color: white;
}

.pc-auth-logo-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.pc-auth-logo-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.pc-auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.pc-auth-header p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */

.pc-form-group {
    margin-bottom: 1.25rem;
}

.pc-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.pc-form-group input[type="text"],
.pc-form-group input[type="email"],
.pc-form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    transition: all 0.2s ease;
}

.pc-form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pc-form-group input::placeholder {
    color: #9ca3af;
}

/* Password wrapper */
.pc-password-wrapper {
    position: relative;
}

.pc-password-wrapper input {
    padding-right: 3rem;
}

.pc-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.pc-password-toggle:hover {
    color: #6b7280;
}

.pc-password-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Password strength */
.pc-password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

/* Form row */
.pc-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Checkbox */
.pc-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.pc-checkbox input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Forgot link */
.pc-forgot-link {
    font-size: 0.875rem;
    color: #2563eb;
    text-decoration: none;
}

.pc-forgot-link:hover {
    text-decoration: underline;
}

/* Error and success messages */
.pc-form-error {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: #b91c1c;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.pc-form-success {
    padding: 0.75rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    color: #065f46;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Terms text */
.pc-terms-text {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 1rem;
}

.pc-terms-text a {
    color: #6b7280;
    text-decoration: underline;
}

.pc-terms-text a:hover {
    color: #374151;
}

/* ==========================================
   BUTTONS
   ========================================== */

.pc-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pc-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.pc-btn-full {
    width: 100%;
}

/* Loading spinner */
.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-loading svg {
    width: 1.25rem;
    height: 1.25rem;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================
   DIVIDER
   ========================================== */

.pc-auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.pc-auth-divider::before,
.pc-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.pc-auth-divider span {
    padding: 0 1rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    text-transform: uppercase;
}

/* ==========================================
   FOOTER
   ========================================== */

.pc-auth-footer {
    text-align: center;
}

.pc-auth-footer p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

.pc-auth-footer a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.pc-auth-footer a:hover {
    text-decoration: underline;
}

/* ==========================================
   PRO BENEFITS SIDEBAR
   ========================================== */

.pc-pro-benefits {
    display: none;
    flex: 1;
    padding: 2.5rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
    color: white;
    max-width: 320px;
}

.pc-pro-benefits h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
}

.pc-pro-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.pc-pro-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.pc-pro-benefits li svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: #a7f3d0;
}

.pc-pro-upgrade-hint {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.pc-pro-upgrade-hint strong {
    color: #fcd34d;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .pc-modal-container {
        flex-direction: column;
        max-height: 95vh;
    }
    
    .pc-auth-form {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    
    .pc-pro-benefits {
        display: none !important;
    }
    
    .pc-modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 2rem;
        height: 2rem;
    }
    
    .pc-auth-header h2 {
        font-size: 1.25rem;
    }
    
    .pc-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (min-width: 769px) {
    .pc-pro-benefits {
        display: block;
    }
}

/* ==========================================
   LOGIN/REGISTER BUTTONS IN HEADER
   ========================================== */

.pc-header-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pc-header-login-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-header-login-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pc-header-register-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: #2563eb;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-header-register-btn:hover {
    background: #1d4ed8;
}

/* User menu dropdown */
.pc-user-menu {
    position: relative;
}

.pc-user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-user-menu-trigger:hover {
    background: #e5e7eb;
}

.pc-user-avatar {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.pc-user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.pc-user-menu:hover .pc-user-menu-dropdown,
.pc-user-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pc-user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s ease;
}

.pc-user-menu-item:hover {
    background: #f3f4f6;
}

.pc-user-menu-item svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #6b7280;
}

.pc-user-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.25rem 0;
}

.pc-user-menu-item.logout {
    color: #dc2626;
}

.pc-user-menu-item.logout svg {
    color: #dc2626;
}

/* Pro badge */
.pc-pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   FEATURE GATING STYLES
   ========================================== */

.pc-pro-feature {
    position: relative;
}

.pc-pro-feature-locked {
    opacity: 0.6;
    pointer-events: none;
}

.pc-pro-feature-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: inherit;
    backdrop-filter: blur(2px);
}

.pc-pro-lock-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.75rem;
    color: #6b7280;
}

.pc-pro-upgrade-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-pro-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.pc-free-reassurance {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.7);
    text-align: center;
}