/* =================================
   СТИЛИ ДЛЯ КАБИНЕТА ЧИТАТЕЛЯ
   ================================= */

/* Основные переменные */
:root {
    --primary-color: #1e3b66;
    --secondary-color: #3fc1f9;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

/* =================================
   ОБЩИЕ СТИЛИ КАБИНЕТА
   ================================= */

.main-content {
    padding-top: 0;
    min-height: calc(100vh - 200px);
    background: #f5f7fa;
}

/* Баннер кабинета */
.cabinet-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.cabinet-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="1.5" fill="white" opacity="0.1"/></svg>');
    background-size: 100px 100px;
}

.cabinet-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

/* =================================
   ВИДЖЕТ ПОЛЬЗОВАТЕЛЯ
   ================================= */

.user-widget {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.user-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.user-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f4;
}

.user-avatar {
    margin-right: 20px;
    position: relative;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 4px 12px rgba(63, 193, 249, 0.3);
}

.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid white;
}

.user-name h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 1.4rem;
}

.reader-id {
    color: var(--text-muted);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
}

.reader-status {
    margin-top: 8px;
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* =================================
   ПЕРСОНАЛЬНАЯ ИНФОРМАЦИЯ
   ================================= */

.personal-info {
    margin-bottom: 30px;
}

.personal-info-item {
    margin-bottom: 18px;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.personal-info-item:last-child {
    border-bottom: none;
}

.personal-info-item label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 13px;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.personal-info-item p {
    color: var(--dark-color);
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

/* =================================
   МЕНЮ КАБИНЕТА
   ================================= */

.cabinet-menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 25px;
}

.cabinet-menu-button {
    display: flex;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 65px;
}

.cabinet-menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2ba8d6 100%);
    transition: left 0.3s ease;
    z-index: 0;
}

.cabinet-menu-button:hover::before {
    left: 0;
}

.cabinet-menu-button:hover {
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(63, 193, 249, 0.4);
}

.cabinet-menu-button i {
    font-size: 22px;
    margin-right: 14px;
    width: 28px;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.cabinet-menu-button span {
    font-size: 16px;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

/* Специальные стили для разных типов кнопок */
.cabinet-menu-button:nth-child(1) {
    border-left: 4px solid var(--info-color);
}

.cabinet-menu-button:nth-child(2) {
    border-left: 4px solid var(--warning-color);
}

.cabinet-menu-button:nth-child(3) {
    border-left: 4px solid var(--danger-color);
}

.cabinet-menu-button:nth-child(4) {
    border-left: 4px solid var(--success-color);
}

.cabinet-menu-button:nth-child(5) {
    border-left: 4px solid #6f42c1;
}

.cabinet-menu-button:nth-child(6) {
    border-left: 4px solid #fd7e14;
}

.cabinet-menu-button:nth-child(7) {
    border-left: 4px solid var(--danger-color);
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

/* =================================
   ВИДЖЕТ АКТИВНОСТИ
   ================================= */

.recent-activity-widget {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 2px solid #f1f3f4;
}

.activity-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
    position: relative;
}

.activity-header h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.activity-list {
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 22px 0;
    border-bottom: 1px solid #f8f9fa;
    transition: var(--transition);
}

.activity-item:hover {
    background: #f8f9fa;
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
    border-radius: 8px;
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.activity-book {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
}

.activity-notification {
    background: linear-gradient(135deg, var(--warning-color), #fd7e14);
    color: white;
}

.activity-return {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
    color: white;
}

.activity-info {
    flex: 1;
}

.activity-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 17px;
}

.activity-details {
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.5;
    font-size: 15px;
}

.activity-time {
    color: #adb5bd;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =================================
   ТАБЛИЦЫ
   ================================= */

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

.table {
    margin: 0;
    background: white;
    font-size: 14px;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color), #2c5282);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 13px;
    padding: 18px 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    border: none;
    padding: 18px 15px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    font-weight: 500;
}

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

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.01);
}

.table tbody tr:hover td {
    color: var(--primary-color);
}

/* =================================
   КНОПКИ
   ================================= */

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 59, 102, 0.3);
}

.btn-outline-success {
    border: 2px solid var(--success-color);
    color: var(--success-color);
    background: transparent;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* =================================
   АДАПТИВНОСТЬ
   ================================= */

@media (max-width: 992px) {
    .cabinet-banner {
        padding: 50px 0;
    }

    .cabinet-banner h1 {
        font-size: 2.2rem;
    }

    .cabinet-menu-buttons {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .cabinet-banner {
        padding: 40px 0;
        text-align: center;
    }

    .cabinet-banner h1 {
        font-size: 2rem;
    }

    .user-info-header {
        flex-direction: column;
        text-align: center;
    }

    .user-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .cabinet-menu-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .activity-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .activity-header h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .activity-item {
        padding: 18px 0;
    }

    .activity-icon {
        width: 45px;
        height: 45px;
        margin-right: 15px;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .user-widget,
    .recent-activity-widget {
        padding: 20px;
        margin-bottom: 20px;
    }

    .cabinet-menu-button {
        padding: 15px 18px;
        min-height: 55px;
    }

    .cabinet-menu-button i {
        font-size: 20px;
        margin-right: 12px;
    }

    .cabinet-menu-button span {
        font-size: 15px;
    }

    .activity-item {
        padding: 15px 0;
    }

    .activity-title {
        font-size: 16px;
    }

    .activity-details {
        font-size: 14px;
    }

    .table thead th,
    .table tbody td {
        padding: 12px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cabinet-banner {
        padding: 30px 0;
    }

    .cabinet-banner h1 {
        font-size: 1.8rem;
    }

    .cabinet-menu-button {
        padding: 12px 15px;
        min-height: 50px;
    }

    .cabinet-menu-button i {
        font-size: 18px;
        margin-right: 10px;
    }

    .cabinet-menu-button span {
        font-size: 14px;
    }

    .user-avatar img {
        width: 70px;
        height: 70px;
    }

    .activity-icon {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* =================================
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
   ================================= */

/* Анимация загрузки */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-widget,
.recent-activity-widget {
    animation: fadeInUp 0.6s ease;
}

.cabinet-menu-button {
    animation: fadeInUp 0.6s ease;
}

.cabinet-menu-button:nth-child(1) { animation-delay: 0.1s; }
.cabinet-menu-button:nth-child(2) { animation-delay: 0.2s; }
.cabinet-menu-button:nth-child(3) { animation-delay: 0.3s; }
.cabinet-menu-button:nth-child(4) { animation-delay: 0.4s; }
.cabinet-menu-button:nth-child(5) { animation-delay: 0.5s; }
.cabinet-menu-button:nth-child(6) { animation-delay: 0.6s; }
.cabinet-menu-button:nth-child(7) { animation-delay: 0.7s; }

/* Пульсация для активных элементов */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(63, 193, 249, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(63, 193, 249, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 193, 249, 0); }
}

.user-avatar img {
    animation: pulse 2s infinite;
}

/* Эффект при скролле */
.cabinet-menu-button:hover {
    animation: none;
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    .user-widget,
    .recent-activity-widget {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .activity-header h3,
    .user-name h3 {
        color: #e2e8f0;
    }

    .personal-info-item label {
        color: #cbd5e0;
    }

    .personal-info-item p {
        color: #e2e8f0;
    }
}
