/* ========================================
   Общие стили для профилей пользователей
   Используются в user_profile.html и user_profile_other.html
   ======================================== */

/* ---------- Компактные таблицы ---------- */
.compact-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 5px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.compact-table {
    margin-bottom: 0;
    font-size: 0.75rem;
}

.compact-table thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

/* ---------- Аватар (общий для обоих профилей) ---------- */
.avatar-section {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.06);
}

/* Для профиля другого пользователя (меньший аватар) */
.avatar-img-sm {
    width: 80px;
    height: 80px;
}

.avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-upload:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.avatar-upload i {
    font-size: 1.2rem;
    color: #007bff;
}

.avatar-upload input[type="file"] {
    display: none;
}

/* ---------- Бейджи ролей ---------- */
.role-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
    margin: 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Градиенты для каждой роли */
.role-badge.role-director {
    background: linear-gradient(135deg, #c71e1e 0%, #8b0000 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(199, 30, 30, 0.3);
}

.role-badge.role-accountant {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.role-badge.role-coordinator {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.role-badge.role-mechanic {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.role-badge.role-driver {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.role-badge.role-candidate {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.role-badge.role-user {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.3);
}

.role-badge.role-other {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(127, 140, 141, 0.3);
}

.role-badge.role-admin {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    position: relative;
    overflow: hidden;
}

/* Специальный эффект для ADMIN - звездочка */
.role-badge.role-admin::before {
    content: "⚡";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0;
    transition: left 0.3s ease, opacity 0.3s ease;
}

.role-badge.role-admin:hover::before {
    left: 5px;
    opacity: 1;
}

.role-badge.role-admin:hover {
    padding-left: 20px;
}

/* Альтернативные варианты (без градиента) */

/* Вариант 2: Сплошные цвета */
.role-badge-solid.role-director { background: #c71e1e; color: white; }
.role-badge-solid.role-accountant { background: #2ecc71; color: white; }
.role-badge-solid.role-coordinator { background: #3498db; color: white; }
.role-badge-solid.role-mechanic { background: #f39c12; color: white; }
.role-badge-solid.role-driver { background: #9b59b6; color: white; }
.role-badge-solid.role-candidate { background: #95a5a6; color: white; }
.role-badge-solid.role-user { background: #1abc9c; color: white; }
.role-badge-solid.role-other { background: #7f8c8d; color: white; }
.role-badge-solid.role-admin { background: #e74c3c; color: white; }

/* Вариант 3: С обводкой (outline) */
.role-badge-outline {
    background: transparent;
    border: 2px solid;
    box-shadow: none;
}

.role-badge-outline.role-director { border-color: #c71e1e; color: #c71e1e; }
.role-badge-outline.role-accountant { border-color: #2ecc71; color: #2ecc71; }
.role-badge-outline.role-coordinator { border-color: #3498db; color: #3498db; }
.role-badge-outline.role-mechanic { border-color: #f39c12; color: #f39c12; }
.role-badge-outline.role-driver { border-color: #9b59b6; color: #9b59b6; }
.role-badge-outline.role-candidate { border-color: #95a5a6; color: #95a5a6; }
.role-badge-outline.role-user { border-color: #1abc9c; color: #1abc9c; }
.role-badge-outline.role-other { border-color: #7f8c8d; color: #7f8c8d; }
.role-badge-outline.role-admin { border-color: #e74c3c; color: #e74c3c; }

/* Вариант 4: Пастельные тона */
.role-badge-pastel.role-director { background: #ffb3b3; color: #8b0000; }
.role-badge-pastel.role-accountant { background: #b3ffb3; color: #27ae60; }
.role-badge-pastel.role-coordinator { background: #b3d9ff; color: #2980b9; }
.role-badge-pastel.role-mechanic { background: #ffe0b3; color: #e67e22; }
.role-badge-pastel.role-driver { background: #e6ccff; color: #8e44ad; }
.role-badge-pastel.role-candidate { background: #e0e0e0; color: #7f8c8d; }
.role-badge-pastel.role-user { background: #ccfff5; color: #16a085; }
.role-badge-pastel.role-other { background: #d9d9d9; color: #7f8c8d; }
.role-badge-pastel.role-admin { background: #ffcccc; color: #c0392b; }

/* Анимация при наведении */
.role-badge {
    transition: all 0.3s ease;
    cursor: default;
}

.role-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Для кликабельных бейджей */
.role-badge-clickable {
    cursor: pointer;
}

.role-badge-clickable:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Группа бейджей */
.role-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Бейдж с иконкой */
.role-badge-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.role-badge-with-icon i {
    font-size: 0.8em;
}

/* Размеры */
.role-badge-sm {
    font-size: 0.65em;
    padding: 0.25em 0.5em;
}

.role-badge-lg {
    font-size: 0.85em;
    padding: 0.4em 0.8em;
}
/* ---------- Карточка профиля ---------- */
.profile-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.profile-card .card-body {
    padding: 20px;
}

/* Компактная карточка для другого профиля */
.compact-card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.compact-card .card-body {
    padding: 12px;
}

.no-padding {
    padding: 0;
}

/* ---------- Информационная сетка ---------- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 20px;
}

/* Вертикальная сетка для другого профиля */
.info-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.info-label-sm {
    font-size: 0.75rem;
    min-width: 80px;
    flex-shrink: 0;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: #2c3e50;
    word-break: break-word;
}

.info-value-sm {
    font-size: 0.9rem;
    max-width: 200px;
}

/* ---------- Telegram блок ---------- */
.telegram-block {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecf2 100%);
    border: none !important;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
    min-width: 280px;
}

.telegram-block-sm {
    min-width: 200px;
    padding: 12px;
}

.telegram-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.telegram-icon {
    background: #0088cc;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.telegram-icon i {
    color: white;
    font-size: 1.2rem;
}

.telegram-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.telegram-code-section {
    background-color: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    width: 100%;
    margin-bottom: 10px;
}

.code-container {
    background: white;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.code-text {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0088cc;
    letter-spacing: 1px;
}

.code-actions {
    display: flex;
    gap: 5px;
}

.bot-reference {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.bot-name {
    font-family: monospace;
    font-size: 0.9rem;
    color: #0088cc;
    font-weight: 500;
}

.telegram-bot-link {
    color: #0088cc !important;
    text-decoration: none !important;
    font-weight: 600;
}

.telegram-bot-link:hover {
    text-decoration: underline !important;
}

/* ---------- Кнопки ---------- */
.btn-icon {
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.btn-generate {
    background: #0088cc;
    color: white;
    border: none;
    width: 100%;
    justify-content: center;
}

.btn-generate:hover {
    background: #006699;
    color: white;
}

.copy-btn {
    font-size: 0.8rem;
    padding: 0 0.25rem;
    line-height: 1;
}

/* ---------- Контейнеры для профиля ---------- */
.profile-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar-info-wrapper {
    flex: 1;
    min-width: 300px;
}

.telegram-wrapper {
    flex-shrink: 0;
}

/* ---------- Пагинация ---------- */
.pagination-container {
    padding: 8px 0;
    background-color: #f8f9fa;
    border-radius: 0 0 4px 4px;
}

.pagination {
    margin-bottom: 0;
}

/* ---------- Утилиты ---------- */
.small-text {
    font-size: 0.8rem;
}

.flex-grow-1 {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 992px) {
    .profile-content {
        flex-direction: column;
    }

    .telegram-wrapper {
        width: 100%;
    }

    .telegram-block,
    .telegram-block-sm {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-label-sm {
        min-width: auto;
    }

    .avatar-section {
        margin-bottom: 15px;
    }

    .avatar-img,
    .avatar-img-sm {
        width: 100px;
        height: 100px;
    }

    .compact-table {
        font-size: 0.65rem;
    }
}