/* Admin Panel - Stylesheet */
:root {
    --primary-green: #0f0;
    --primary-cyan: #0ff;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(10, 10, 10, 0.8);
    --border-green: rgba(0, 255, 0, 0.5);
    --text-primary: #0f0;
    --text-secondary: #888;
    --error-red: #f44;
    --success-green: #4f4;
}

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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: var(--bg-card);
    border: 2px solid var(--primary-green);
    border-radius: 15px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2em;
    color: var(--primary-green);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    letter-spacing: 5px;
}

.login-header p {
    color: var(--primary-cyan);
    margin-top: 5px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.login-form input {
    width: 100%;
    padding: 12px;
    background: #111;
    border: 1px solid var(--border-green);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1em;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.error-message {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid var(--error-red);
    color: var(--error-red);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-green);
}

.login-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--primary-cyan);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.1));
    border: 2px solid var(--primary-green);
    border-radius: 5px;
    color: var(--primary-green);
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
}

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--text-secondary);
    border-radius: 5px;
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.btn-danger {
    padding: 8px 16px;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid var(--error-red);
    border-radius: 5px;
    color: var(--error-red);
    font-family: inherit;
    cursor: pointer;
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.4);
}

/* Layout */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--primary-green);
    border-radius: 10px;
    margin-bottom: 30px;
}

.admin-header h1 {
    color: var(--primary-green);
    font-size: 1.5em;
    letter-spacing: 3px;
}

.admin-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.admin-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.admin-nav a:hover, .admin-nav a.active {
    color: var(--primary-cyan);
    background: rgba(0, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--primary-cyan);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 2px solid var(--primary-green);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-green);
}

.card-header h2 {
    color: var(--primary-cyan);
    font-size: 1.2em;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    color: var(--primary-green);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-green);
}

.data-table th {
    color: var(--primary-cyan);
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.85em;
}

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

.data-table .actions {
    display: flex;
    gap: 10px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
}

.badge-admin {
    background: rgba(0, 255, 0, 0.2);
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.badge-user {
    background: rgba(0, 255, 255, 0.2);
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
}

.badge-viewer {
    background: rgba(136, 136, 136, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.badge-super {
    background: rgba(255, 215, 0, 0.2);
    color: gold;
    border: 1px solid gold;
}

.badge-active {
    background: rgba(0, 255, 0, 0.2);
    color: var(--success-green);
}

.badge-inactive {
    background: rgba(255, 68, 68, 0.2);
    color: var(--error-red);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    background: #111;
    border: 1px solid var(--border-green);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* Role Matrix */
.role-matrix {
    display: grid;
    gap: 10px;
}

.role-row {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #111;
    border-radius: 5px;
}

.role-row .service-name {
    flex: 1;
    color: var(--primary-cyan);
}

.role-row select {
    width: 120px;
    padding: 5px 10px;
    background: #0a0a0a;
    border: 1px solid var(--border-green);
    color: var(--text-primary);
    border-radius: 3px;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-green);
}

/* Messages */
.success-message {
    background: rgba(79, 244, 79, 0.15);
    border: 2px solid var(--success-green);
    color: var(--success-green);
    padding: 15px 15px 15px 45px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(79, 244, 79, 0.3);
    animation: slideDown 0.4s ease-out, fadeIn 0.4s ease-out;
}

.success-message::before {
    content: '✓';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    font-weight: bold;
    color: var(--success-green);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-dark);
    border: 2px solid var(--primary-green);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.modal h3 {
    color: var(--primary-cyan);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .data-table {
        font-size: 0.9em;
    }
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}
.strength-bar-container {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}
.strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s, background-color 0.3s;
    border-radius: 2px;
}
.strength-text {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}
.strength-requirements {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
}
.strength-requirements li {
    padding: 2px 0;
}

/* MFA-specific badge styles */
.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

/* Info message (for login grace period warnings) */
.info-message {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-green);
    border-radius: 5px;
    color: var(--primary-cyan);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-cyan);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-cyan));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    font-size: 14px;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 220px;
    background: var(--bg-dark);
    border: 1px solid var(--primary-green);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 255, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-green);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-header strong {
    color: var(--primary-cyan);
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 255, 0, 0.1);
    color: var(--primary-green);
}

.dropdown-item-danger {
    color: var(--error-red);
}

.dropdown-item-danger:hover {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error-red);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-green);
    margin: 5px 0;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 5px;
    color: var(--primary-green);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-green);
    color: #000;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.user-name {
    color: var(--primary-green);
    font-size: 14px;
}

.dropdown-arrow {
    font-size: 10px;
    color: var(--primary-cyan);
    transition: transform 0.3s ease;
}

.user-menu-trigger:hover .dropdown-arrow {
    transform: translateY(2px);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--bg-dark);
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-green);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-header strong {
    color: var(--primary-green);
    font-size: 14px;
}

.dropdown-item {
    display: block;
    padding: 12px 15px;
    color: var(--primary-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dropdown-item:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-cyan);
    padding-left: 20px;
}

.dropdown-item-danger {
    color: var(--error-red);
}

.dropdown-item-danger:hover {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error-red);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-green);
    margin: 5px 0;
}
