/* Access Management Master-Detail Interface */
/* Extends existing glassmorphism patterns from base admin styles */

.access-management-container {
    margin: 2rem auto;
    max-width: 1400px;
}

/* Stats Header */
.stats-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    color: #0096ff;
    width: 60px;
    text-align: center;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

/* Split View Container */
.split-view-container {
    display: flex;
    height: calc(100vh - 300px);
    min-height: 600px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Master Panel (30%) */
.master-panel {
    width: 30%;
    min-width: 320px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

/* Search Controls */
.search-controls {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.search-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    background: rgba(40, 40, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding-right: 2.5rem;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #0096ff;
    box-shadow: 0 0 0 0.25rem rgba(0, 150, 255, 0.25);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-select {
    background: rgba(40, 40, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.875rem;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* User List */
.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.user-item:hover {
    background: rgba(0, 150, 255, 0.1);
    border-color: rgba(0, 150, 255, 0.3);
}

.user-item.active {
    background: rgba(0, 150, 255, 0.2);
    border-color: #0096ff;
}

.user-checkbox {
    margin-right: 0.75rem;
}

.user-select-checkbox {
    transform: scale(1.1);
}

.user-avatar-container {
    position: relative;
    margin-right: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.status-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    border: 2px solid rgba(0, 0, 0, 0.8);
}

.status-overlay.inactive {
    background: #dc3545;
    color: #fff;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-indicators {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.indicator {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.whitelist-indicator {
    color: #28a745;
}

.invite-indicator {
    color: #17a2b8;
}

.role-indicator {
    color: #ffc107;
}

.email-unverified {
    color: #fd7e14;
}

.invite-count {
    font-size: 0.65rem;
}

/* Resize Handle */
.resize-handle {
    width: 4px;
    cursor: col-resize;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.resize-handle:hover {
    background: rgba(0, 150, 255, 0.5);
}

/* Detail Panel (70%) */
.detail-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    padding: 1.5rem;
}

/* Detail Placeholder */
.detail-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.3);
}

.placeholder-features {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Detail Content */
.detail-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-avatar-section {
    position: relative;
}

.detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.status-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid rgba(0, 0, 0, 0.8);
}

.status-badge.active {
    background: #28a745;
    color: #fff;
}

.status-badge.inactive {
    background: #dc3545;
    color: #fff;
}

.detail-user-info {
    flex: 1;
}

.detail-user-name {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.detail-user-email {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.detail-user-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.role-badge.role-admin {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.role-badge.role-user {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.verification-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.verification-badge.verified {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.verification-badge.unverified {
    background: rgba(253, 126, 20, 0.2);
    color: #fd7e14;
    border: 1px solid rgba(253, 126, 20, 0.3);
}

/* Glass Cards - reuse existing pattern */
.glass-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.glass-card .card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.glass-card .card-header h4 {
    color: #0096ff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-card .card-content {
    padding: 1.5rem;
}

/* Form Elements */
.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.editable-field {
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.editable-field:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-label {
    background-color: #0096ff;
    border-color: #0096ff;
}

input:checked + .toggle-label:before {
    transform: translateX(26px);
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-indicator.whitelisted {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-indicator.not-whitelisted {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Invite Stats */
.invite-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0096ff;
    line-height: 1;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

/* Recent Invites */
.recent-invites h5 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.invite-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-token {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.invite-recipient {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Activity Info */
.activity-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.activity-item i {
    color: #0096ff;
    width: 20px;
    text-align: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: #fff;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #0096ff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .split-view-container {
        flex-direction: column;
        height: auto;
    }

    .master-panel {
        width: 100%;
        height: 40vh;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .resize-handle {
        display: none;
    }

    .stats-header {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .access-management-container {
        margin: 1rem;
    }

    .stats-header {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .detail-user-meta {
        justify-content: center;
    }

    .invite-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filter-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Form styling to match existing patterns */
.form-control, .form-select {
    background: rgba(40, 40, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #0096ff;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(0, 150, 255, 0.25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.edit-form {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}