/* Modern Profile Modal Styles */

.auth-modal-large {
    background: #1a1a2e;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.2);
    overflow: hidden;
    border: 1px solid #00ff88;
}

.modal-header-modern {
    padding: 32px 40px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #00ff88;
}

.modal-title-modern {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.modal-subtitle {
    font-size: 14px;
    color: #00ff88;
    margin: 0;
}

.modal-close-modern {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 32px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close-modern:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-tabs {
    display: flex;
    background: #0f0f1e;
    border-bottom: 1px solid #00ff88;
    padding: 0 40px;
}

.modal-tab {
    padding: 16px 32px;
    background: none;
    border: none;
    color: #888;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.modal-tab:hover {
    color: #fff;
    background: rgba(0, 255, 136, 0.1);
}

.modal-tab.active {
    color: #00ff88;
    border-bottom-color: #00ff88;
    background: #1a1a2e;
}

.modal-body-modern {
    flex: 1;
    overflow-y: auto;
    background: #1a1a2e;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.profile-table-container {
    padding: 0;
}

.profile-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.profile-table thead {
    background: rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.profile-table th {
    padding: 18px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #00ffff;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.profile-table td {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
}

.profile-table tbody tr {
    transition: all 0.2s ease;
}

.profile-table tbody tr:hover {
    background: rgba(0, 255, 255, 0.08);
}

.profile-table tbody tr:hover td {
    background: transparent;
}

/* Excel-like zebra rows for better scanability */
.profile-table tbody tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.04);
}
.profile-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

/* Slightly tighter rows */
.profile-table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
}

.field-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.field-value {
    color: #fff;
    font-size: 14px;
}

.field-value code {
    background: rgba(0, 255, 136, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    color: #00ff88;
    font-weight: 600;
    border: 1px solid #00ff88;
}

.type-badge {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.type-badge.system {
    background: rgba(25, 118, 210, 0.2);
    color: #64b5f6;
}

.type-badge.auth {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.type-badge.date {
    background: rgba(245, 124, 0, 0.2);
    color: #ffb74d;
}

.type-badge.role {
    background: rgba(123, 31, 162, 0.2);
    color: #ba68c8;
}

.type-badge.action {
    background: rgba(194, 24, 91, 0.2);
    color: #f48fb1;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.success {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.status-badge.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-badge.danger {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
}

.profile-action-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
}

.profile-action-btn.secondary {
    background: transparent;
    border: 2px solid #00ff88;
    color: #00ff88;
}

.profile-action-btn.secondary:hover {
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: none;
}

.copy-btn-inline {
    background: transparent;
    border: 1px solid #00ff88;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    color: #00ff88;
    margin-left: 12px;
    transition: all 0.2s;
}

.copy-btn-inline:hover {
    border-color: #00ff88;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #888;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #fff;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
}

.qr-container-modern {
    background: rgba(0, 255, 136, 0.05);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin: 24px 0;
    border: 2px dashed #00ff88;
}

.qr-code-display {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
}

.qr-timer {
    font-size: 18px;
    font-weight: 600;
    color: #00ff88;
    margin-top: 16px;
}

/* Account dropdown panel (application-like) */
.account-panel {
    padding: 8px 8px 10px;
    min-width: 280px;
}

.account-panel .user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px;
}

.account-panel .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0, 255, 136, 0.8);
    box-shadow: 0 2px 6px rgba(0, 255, 136, 0.3);
}

.account-panel .user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-panel .user-title {
    font-size: 13px;
    color: #cfd8dc;
    letter-spacing: 0.3px;
}

.account-panel .user-id {
    font-size: 12px;
    color: #90a4ae;
}

.account-panel .menu-option .menu-hint {
    color: #90a4ae;
}

#account-totp-status {
    font-weight: 700;
}

/* Devices Grid */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 24px;
}

.device-card {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.device-card:hover {
    border-color: #00ff88;
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.2);
}

.device-card.current {
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.device-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #fff;
}

.device-type {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #aaa;
}

.device-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 255, 136, 0.2);
}

.revoke-btn {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.revoke-btn:hover {
    background: #e74c3c;
    color: white;
}

/* Admin Dashboard Styles */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
}

.admin-stat-card {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 8px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #00ffff;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-search-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
}

.admin-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.admin-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .auth-modal-large {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-tabs {
        padding: 0 20px;
        overflow-x: auto;
    }
    
    .modal-tab {
        padding: 16px 20px;
        white-space: nowrap;
    }
    
    .devices-grid {
        grid-template-columns: 1fr;
    }
}
