/* HOAPOST - Common Card-Based Components */
/* Shared styling for professional card layouts */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors - Blue and White Theme */
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-light: #dbeafe;
    --secondary-color: #3b82f6;
    --accent-color: #3b82f6;
    
    /* Approved Profile Modal Colors */
    --primary-blue: #1e40af;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1d4ed8;
    --secondary-blue: #eff6ff;
    --secondary-blue-dark: #dbeafe;
    --success-green: #10b981;
    --error-red: #ef4444;
    
    /* Neutral Color Palette */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    
    /* UI Colors */
    --background-color: #ffffff;
    --card-background: #ffffff;
    --border-color: #3b82f6;
    --text-color: #1e40af;
    --text-secondary: #3b82f6;
    --text-muted: #1e40af;
    
    /* Status Colors */
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --error-color: #ef4444;
    --error-bg: #fee2e2;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    line-height: 1.6;
    min-height: 100vh;
}

/* Card Components */
.card {
    background: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15), 0 15px 15px -5px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 2px solid #3b82f6;
    background: #ffffff;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
}

/* Form Components */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #1e40af;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    transform: translateY(-1px);
}

.form-input:invalid {
    border-color: var(--error-color);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: 0.25rem;
    display: none;
}

.form-success {
    font-size: 0.875rem;
    color: var(--success-color);
    background-color: var(--success-bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #a7f3d0;
    margin-top: 1rem;
    display: none;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #1e40af;
    color: white;
    border: 2px solid #1e40af;
}

.btn-primary:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #1e40af;
    border: 2px solid #3b82f6;
}

.btn-secondary:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-ghost {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background-color: var(--primary-light);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn.loading {
    color: transparent;
}

.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Input with Icon Components */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem;
}

.input-icon:hover {
    color: var(--text-secondary);
}

/* Status Components */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: var(--success-color);
}

.status-offline {
    background-color: var(--error-color);
}

.status-warning {
    background-color: var(--warning-color);
}

/* Alert Components */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: var(--error-bg);
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background-color: var(--warning-bg);
    border-color: #fcd34d;
    color: #92400e;
}

/* Link Components */
.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.p-4 {
    padding: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        margin: 1rem;
        border-radius: var(--radius-md);
    }
    
    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .card {
        margin: 0.5rem;
        border-radius: var(--radius-sm);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   MODAL STYLES
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-close,
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover,
.close-btn:hover {
    background: var(--error-bg);
    color: var(--error-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Modal form styles */
.modal .form-group {
    margin-bottom: 1rem;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal .form-group input:focus,
.modal .form-group textarea:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ==========================================
   APPROVED PROFILE MODAL STYLES
   ========================================== */

.profile-info {
    max-width: 100%;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--secondary-blue);
    border-radius: 12px;
    border: 1px solid var(--primary-blue-light);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-details h3 {
    margin: 0 0 0.5rem 0;
    color: var(--neutral-800);
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-details p {
    margin: 0;
    color: var(--neutral-600);
    font-size: 0.875rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-blue);
    color: white;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.5rem 0 0 0;
}

.profile-sections {
    display: grid;
    gap: 1.5rem;
}

.profile-section {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: 8px;
    padding: 1.25rem;
}

.profile-section h4 {
    margin: 0 0 1rem 0;
    color: var(--neutral-700);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--neutral-200);
    padding-bottom: 0.5rem;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--neutral-100);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    font-weight: 600;
    color: var(--neutral-600);
    margin: 0;
}

.field-value {
    color: var(--neutral-800);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-value.anonymous-id {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.field-value.status-active {
    color: var(--success-green);
    font-weight: 600;
}

.anonymous-id-description {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Profile Modal Action Buttons */
.profile-section .btn-secondary,
.profile-section .btn-danger {
    width: 100%;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-section .btn-danger {
    margin-bottom: 0;
}

.danger-zone-text {
    color: var(--neutral-500);
    font-size: 0.75rem;
    margin-top: 8px;
    text-align: center;
}

/* Mobile modal styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}