/* ============================================================================
   FILE: assets/css/frontend.css
   Frontend Styles for Visitor Auth Pro v3.0
   Includes Profile Management Styles
   ============================================================================ */

/* CSS Variables */
:root {
    --vis-primary: var(--wp-admin-theme-color, #0073aa);
    --vis-primary-rgb: 0, 115, 170;
    --vis-text: #1e293b;
    --vis-text-light: #64748b;
    --vis-background: #ffffff;
    --vis-border: #e2e8f0;
    --vis-radius: 8px;
    --vis-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --vis-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --vis-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Container */
.vis-auth-container {
    box-sizing: border-box;
    width: 100%;
    font-family: inherit;
}

.vis-auth-container * {
    box-sizing: border-box;
}

/* Login Button */
.vis-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--vis-background);
    border: 2px solid var(--vis-border);
    border-radius: var(--vis-radius);
    font-size: 16px;
    font-weight: 600;
    color: var(--vis-text);
    text-decoration: none;
    transition: var(--vis-transition);
    cursor: pointer;
    line-height: 1.5;
}

.vis-login-button:hover,
.vis-login-button:focus {
    transform: translateY(-2px);
    box-shadow: var(--vis-shadow-hover);
    border-color: var(--vis-primary);
    text-decoration: none;
    color: var(--vis-primary);
}

.vis-login-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Button Variants */
.vis-login-button.minimal {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--vis-primary);
}

.vis-login-button.rounded {
    border-radius: 50px;
}

.vis-login-button.filled {
    background: var(--vis-primary);
    color: white;
    border-color: var(--vis-primary);
}

/* User Card */
.vis-user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--vis-primary) 0%, var(--vis-primary) 100%);
    border-radius: var(--vis-radius);
    color: white;
    box-shadow: var(--vis-shadow);
}

.vis-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.vis-user-info {
    flex: 1;
    min-width: 0;
}

.vis-user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
}

.vis-user-email {
    opacity: 0.9;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.vis-logout-button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--vis-radius);
    color: white;
    text-decoration: none;
    transition: var(--vis-transition);
    font-size: 14px;
    font-weight: 500;
}

.vis-logout-button:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    color: white;
}

/* Protected Content Message */
.vis-protected-message {
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--vis-primary) 0%, var(--vis-primary) 100%);
    border-radius: var(--vis-radius);
    color: white;
    box-shadow: var(--vis-shadow);
}

.vis-protected-message h2 {
    margin: 0 0 16px;
    font-size: 24px;
    color: white;
}

/* Profile Management Styles */
.vis-profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.vis-profile-header {
    text-align: center;
    margin-bottom: 40px;
}

.vis-profile-header h1 {
    font-size: 32px;
    color: var(--vis-text);
    margin: 0 0 10px;
}

.vis-profile-header p {
    color: var(--vis-text-light);
    font-size: 16px;
}

.vis-profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    color: white;
}

.vis-avatar-wrapper {
    position: relative;
}

.vis-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

#vis-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vis-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.vis-avatar-preview:hover .vis-avatar-overlay {
    opacity: 1;
}

.vis-avatar-overlay .dashicons {
    font-size: 32px;
    color: white;
}

.vis-avatar-info h3 {
    margin: 0 0 5px;
    font-size: 24px;
}

.vis-avatar-info p {
    margin: 0 0 15px;
    opacity: 0.9;
}

.vis-form-section {
    background: white;
    border: 1px solid var(--vis-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.vis-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--vis-text);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.vis-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.vis-form-row:last-child {
    margin-bottom: 0;
}

.vis-form-col-full {
    grid-column: 1 / -1;
}

.vis-profile-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.vis-profile-form input[type="text"],
.vis-profile-form input[type="email"],
.vis-profile-form input[type="tel"],
.vis-profile-form input[type="url"],
.vis-profile-form input[type="date"],
.vis-profile-form select,
.vis-profile-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--vis-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.vis-profile-form input:focus,
.vis-profile-form select:focus,
.vis-profile-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.vis-profile-form input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.vis-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.vis-btn-primary {
    background: #667eea;
    color: white;
}

.vis-btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.vis-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.vis-btn-secondary:hover {
    background: #e2e8f0;
}

.vis-form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
}

.vis-text-muted {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}

/* Notifications */
.vis-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 350px;
}

.vis-notification-show {
    transform: translateX(0);
}

.vis-notification-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.vis-notification-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.vis-notification-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.vis-notification-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Modal Overlay */
.vis-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: vis-fade-in 0.3s ease;
}

.vis-modal {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: vis-slide-up 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.vis-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--vis-text-light);
    transition: var(--vis-transition);
}

.vis-modal-close:hover {
    color: var(--vis-text);
    transform: rotate(90deg);
}

.vis-google-login-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    background: var(--vis-primary);
    color: white;
    border: none;
    border-radius: var(--vis-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--vis-transition);
    text-decoration: none;
    font-weight: 600;
}

.vis-google-login-btn:hover {
    background: var(--vis-primary);
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--vis-shadow-hover);
}

/* Profile Card Widget */
.vis-profile-card {
    background: white;
    border: 1px solid var(--vis-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.vis-profile-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.vis-profile-card h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: var(--vis-text);
}

.vis-profile-card p {
    margin: 0 0 5px;
    color: var(--vis-text-light);
    font-size: 14px;
}

/* Loading States */
.vis-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.vis-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--vis-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: vis-spin 0.8s linear infinite;
}

/* Animations */
@keyframes vis-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes vis-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes vis-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vis-user-card {
        flex-direction: column;
        text-align: center;
    }
    
    .vis-modal {
        padding: 24px;
        width: 95%;
    }
    
    .vis-protected-message {
        padding: 24px;
    }
    
    .vis-form-row {
        grid-template-columns: 1fr;
    }
    
    .vis-profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }
    
    .vis-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --vis-background: #1a1a1a;
        --vis-text: #e2e8f0;
        --vis-text-light: #94a3b8;
        --vis-border: #334155;
    }
    
    .vis-modal,
    .vis-form-section,
    .vis-profile-card {
        background: #1e293b;
    }
    
    .vis-login-button {
        background: #2a2a2a;
    }
}

/* Accessibility */
.vis-login-button:focus,
.vis-logout-button:focus,
.vis-modal-close:focus,
.vis-google-login-btn:focus,
.vis-btn:focus {
    outline: 2px solid var(--vis-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .vis-logout-button,
    .vis-login-button,
    .vis-modal-overlay,
    .vis-notification {
        display: none !important;
    }
}