/* =========================================
   Bare UI Modals (Dashboard)
   ========================================= */

/* Overlay */
.bare-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bare-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Base */
.bare-modal {
    background: #fff;
    width: 100%;
    max-width: 400px;
    background: #fff;
    box-shadow: var(--bare-shadow-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 90vh;
}

/* Large Modal (Dashboard) */
.bare-modal-lg {
    max-width: 800px;
}

/* Desktop: Center Modal */
@media (min-width: 768px) {
    .bare-modal {
        border-radius: var(--bare-radius-lg);
        transform: scale(0.95);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    }

    .bare-modal-overlay.active .bare-modal {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile: Bottom Sheet */
@media (max-width: 767px) {
    .bare-modal-overlay {
        align-items: flex-end;
        /* Align to bottom */
    }

    .bare-modal {
        max-width: 100%;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        max-height: 85vh;
        /* Taller on mobile */
    }

    .bare-modal-overlay.active .bare-modal {
        transform: translateY(0);
    }
}

/* Fix Password Input Wrapper & Eye Icon */
.bare-form-group {
    margin-bottom: 1rem;
}

.bare-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.bare-password-wrapper input {
    width: 100%;
    padding-right: 40px;
    /* Space for icon */
}

.bare-toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--bare-text-muted, #64748b);
    z-index: 2;
    font-size: 1.25rem;
}

/* Header */
.bare-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--bare-border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: inherit;
    /* Follow parent radius */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    flex-shrink: 0;
}

.bare-modal-title {
    font-size: 1.125rem;
    /* 18px */
    font-weight: 700;
    color: var(--bare-text-dark, #1f2937);
    margin: 0;
}

.bare-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--bare-text-muted, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.bare-modal-close:hover {
    background: var(--bare-bg-gray, #f1f5f9);
    color: var(--bare-text-dark, #1f2937);
}

/* Body */
.bare-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    /* Take remaining space */
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.bare-modal-body::-webkit-scrollbar {
    width: 6px;
}

.bare-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.bare-modal-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Footer */
.bare-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--bare-border-color, #e2e8f0);
    background: #fff;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: inherit;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    flex-shrink: 0;
}

/* Summary Cards (Displayed in Main Form) */
.bare-summary-card {
    background: #fff;
    border: 1px solid var(--bare-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.bare-summary-card:hover {
    border-color: var(--bare-primary, #66bb6a);
}

.bare-summary-content h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bare-text-dark, #1f2937);
    margin-bottom: 4px;
}

.bare-summary-content p {
    font-size: 0.875rem;
    color: var(--bare-text-muted, #64748b);
    margin: 0;
    line-height: 1.4;
}

/* Auth Views */
.bare-auth-view {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Brand Icons (Rectangular with Text) */
.bare-social-buttons.brand-icons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bare-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--bare-border-color, #e2e8f0);
    border-radius: 99px;
    /* Pill shape */
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bare-text-dark, #1f2937);
    transition: all 0.2s ease;
    cursor: pointer;
}

.bare-social-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bare-social-btn img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: block;
    flex-shrink: 0;
}


/* Hide Legacy Header Buttons (Redundant) */
.me-header-actions,
.me-header-btn,
.me-login-links {
    display: none !important;
}

/* Specific Details Grid Layout (Added for Refactor) */
.bare-details-group h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bare-text-dark, #1f2937);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--bare-border-color, #e5e7eb);
    padding: 0.8rem;
    border-radius: var(--bare-radius-md);
    background: var(--bare-primary-light);
    color: var(--bare-primary);
}

.bare-details-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .bare-details-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bare-details-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bare-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border: 1px solid var(--bare-border-color, #e5e7eb);
    border-radius: var(--bare-radius-md, 8px);
    cursor: pointer;
    background-color: var(--bare-bg-white, #fff);
    transition: all 0.2s ease;
}

.bare-detail-item:hover {
    border-color: var(--bare-primary, #6366f1);
    background-color: var(--bare-bg-gray, #f9fafb);
}

.bare-detail-item.bg-blue-50\/50,
.bare-detail-item:has(input:checked) {
    border-color: var(--bare-primary, #6366f1);
    background-color: rgba(99, 102, 241, 0.05);
}

.bare-detail-item span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bare-text-dark, #374151);
}


/* Search Input Fix (Icon position) */
.bare-modal-search-wrapper .relative {
    position: relative;
    display: flex;
    align-items: center;
}

.bare-modal-search-wrapper .ph-magnifying-glass {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bare-text-light, #9ca3af);
    pointer-events: none;
    z-index: 10;
}

.bare-modal-search-wrapper input#bare-details-search {
    width: 100%;
    padding-left: 40px;
    /* Space for icon */
    padding-right: 16px;
    height: 44px;
    border: 1px solid var(--bare-border-color, #e5e7eb);
    border-radius: var(--bare-radius-md, 8px);
}