/* Modern Dark Glassmorphism CSS Architecture for Entra ID SCIM IAM */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(18, 26, 44, 0.7);
    --bg-card-hover: rgba(26, 37, 63, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 162, 255, 0.3);
    
    --primary: #0078d4;
    --primary-glow: rgba(0, 120, 212, 0.4);
    --accent-blue: #00d2ff;
    --accent-purple: #9d4edd;
    
    --success: #107c41;
    --success-glow: rgba(16, 124, 65, 0.4);
    --warning: #f2994a;
    --danger: #e31a1c;
    --danger-glow: rgba(227, 26, 28, 0.4);

    --text-main: #f0f4f8;
    --text-muted: #8a99ad;
    --text-dim: #5c6b73;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(0, 120, 212, 0.25);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 120, 212, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(157, 78, 221, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* App Header */
.app-header {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 120, 212, 0.5);
    color: white;
    font-size: 20px;
}

.brand-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #ffffff, #a5c0ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-title p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 124, 65, 0.15);
    border: 1px solid rgba(16, 124, 65, 0.4);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4ade80;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Layout Main */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Stats Overview Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 4px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
}

.stat-icon.primary { color: var(--accent-blue); background: rgba(0, 210, 255, 0.1); }
.stat-icon.success { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.stat-icon.warning { color: var(--warning); background: rgba(242, 153, 74, 0.1); }
.stat-icon.danger { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* Navigation Tabs */
.tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), #005a9e);
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.3);
}

/* Tab Content Sections */
.tab-content {
    display: none;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Content Panel Glass Card */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.panel-title p {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Table Design */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: rgba(16, 124, 65, 0.2); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); }
.badge-suspended { background: rgba(242, 153, 74, 0.2); color: var(--warning); border: 1px solid rgba(242, 153, 74, 0.3); }
.badge-offboarded { background: rgba(248, 113, 113, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2b3a55, #162238);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #005a9e);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #106ebe, #004578);
    box-shadow: 0 6px 18px rgba(0, 120, 212, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-warning {
    background: rgba(242, 153, 74, 0.15);
    color: var(--warning);
    border: 1px solid rgba(242, 153, 74, 0.3);
}

.btn-warning:hover {
    background: rgba(242, 153, 74, 0.25);
}

.btn-danger {
    background: rgba(227, 26, 28, 0.15);
    color: #f87171;
    border: 1px solid rgba(227, 26, 28, 0.3);
}

.btn-danger:hover {
    background: rgba(227, 26, 28, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-main);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* Diagnostic Console Output */
.console-box {
    background: #060911;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.825rem;
    color: #a5f3fc;
    max-height: 250px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1e293b;
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.875rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
