﻿/* ===================================
   OAuth Server - Единый CSS файл
   Bootstrap 5 + кастомные стили
   =================================== */

/* ===================================
   LOGIN/AUTH: Input group styles
   =================================== */
.input-group-text {
    background-color: #f8f9fa;
    border-right: 0;
}

.input-group .form-control {
    border-left: 0;
}

.input-group:focus-within .input-group-text {
    border-color: #86b7fe;
}

.input-group:focus-within .form-control {
    border-color: #86b7fe;
}

/* ===================================
   LAYOUT: Sidebar + Main Content
   =================================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: #1a1d21;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar .sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
}

.sidebar .sidebar-brand:hover {
    color: #fff;
}

.sidebar .brand-icon {
    width: 36px;
    height: 36px;
    background: #0d6efd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.sidebar .brand-text {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Navigation links - using .sidebar-link to avoid Bootstrap .nav-item conflict */
.sidebar .sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar .nav-section {
    margin-bottom: 24px;
}

.sidebar .nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    padding: 0 12px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(13, 110, 253, 0.3);
    color: #fff;
    font-weight: 600;
}

.sidebar-link i {
    width: 20px;
    margin-right: 10px;
    font-size: 16px;
}

/* Sidebar Footer */
.sidebar .sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar .user-info {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 8px;
}

.sidebar .user-info:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar .user-avatar {
    width: 36px;
    height: 36px;
    background: #0d6efd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

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

.sidebar .user-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: #f5f7fa;
    min-height: 100vh;
}

.content-wrapper {
    padding: 24px;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.page-subtitle {
    color: #6c757d;
    margin: 0;
}

/* ===================================
   COMPONENTS
   =================================== */

/* User Avatars */
.user-avatar {
    width: 36px;
    height: 36px;
    background: #0d6efd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.user-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

/* Icons */
.client-icon,
.role-icon {
    width: 48px;
    height: 48px;
    background: #e0e7ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.25rem;
}

.list-group-item.active .client-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.role-icon {
    background: #d1fae5;
    color: #10b981;
}

/* Client List */
.client-list {
    max-height: 550px;
    overflow-y: auto;
}

.client-list::-webkit-scrollbar {
    width: 6px;
}

.client-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.client-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.client-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Role Cards */
.role-card {
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.role-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Permission Chips */
.permission-chip {
    transition: all 0.2s ease;
}

.permission-chip:hover:not(.btn-success) {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Empty States */
.empty-icon,
.no-selection-icon {
    font-size: 3rem;
    color: #9ca3af;
}

/* ===================================
   BOOTSTRAP OVERRIDES
   =================================== */

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th, .table td {
    vertical-align: middle;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Dropdown */
.dropdown-menu.show {
    display: block;
}

/* ===================================
   BLAZOR SPECIFIC
   =================================== */
#blazor-error-ui {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 10000;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

#blazor-error-ui .reload {
    background: #0d6efd;
    color: white;
}

#blazor-error-ui .reload:hover {
    background: #0b5ed7;
}

#blazor-error-ui .dismiss {
    background: #e5e7eb;
    color: #374151;
}

#blazor-error-ui .dismiss:hover {
    background: #d1d5db;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .client-list {
        max-height: 300px;
    }
}

/* ===================================
   USABILITY ENHANCEMENTS
   =================================== */

/* Hover cards (dashboard stats) */
.hover-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Smooth page transitions */
.content-wrapper {
    animation: fadeIn 0.2s ease;
}

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

.oauth-client-logo {
    max-height: 60px;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

.oauth-client-icon {
    width: 70px;
    height: 70px;
}

.oauth-center-logo {
    width: 80px;
    height: 80px;
}

/* Bootstrap .fs-1 equivalent for icons if not loaded */
.fs-1 {
    font-size: 2.5rem !important;
}
}
