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

/* Кнопка-триггер */
.widgets-trigger {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: white;
    border-radius: 24px 0 0 24px;
    padding: 18px 7px;
    cursor: grab;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 7px 24px rgba(0, 0, 0, 0.4);
    min-height: 72px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.widgets-trigger:hover {
    transform: translateY(-50%) translateX(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #3a3a3a 0%, #2c2c2c 100%);
    border-color: #666;
}

.widgets-trigger:active,
.widgets-trigger.dragging {
    cursor: grabbing;
    transform: translateY(-50%) translateX(-6px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #4a4a4a 0%, #3c3c3c 100%);
    border-color: #888;
    transition: none;
}

.widgets-trigger.dragging {
    opacity: 0.9;
    z-index: 1001;
}

.widgets-trigger .trigger-icon {
    font-size: 1.44rem;
    color: #c0c0c0;
    margin: 0;
}

.widgets-trigger .trigger-icon i {
    display: block;
}

/* Панель виджетов */
.widgets-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    color: white;
    border-left: 1px solid #444;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Компенсация zoom для панели виджетов на десктопе */
@media (min-width: 769px) {
    .widgets-panel {
        /* Компенсируем zoom: 0.7 чтобы панель была на полную высоту */
        height: calc(100vh / 0.7);
        min-height: calc(100vh / 0.7);
        max-height: calc(100vh / 0.7);
    }
    
    .widgets-content {
        height: calc((100vh / 0.7) - 70px);
    }
}

.widgets-panel.active {
    right: 0;
}

/* Заголовок панели */
.widgets-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
    height: 70px;
    box-sizing: border-box;
}

.widgets-header h4 {
    margin: 0;
    font-weight: 600;
    color: #e5e5e5;
}

.close-panel {
    background: transparent;
    border: none;
    color: #c0c0c0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
    color: #fff;
}

/* Контент панели */
.widgets-content {
    padding: 15px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
}

/* Общие стили для виджетов */
.widget {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 15px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0;
}

.widget:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.1rem;
}

.widget-header i {
    margin-right: 10px;
    color: #c0c0c0;
    font-size: inherit;
}

.widget-title-link {
    color: #e5e5e5;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.widget-title-link:hover {
    color: #fff;
    transform: translateX(2px);
}

.widget-title-link i {
    margin-right: 10px;
    color: #c0c0c0;
    transition: color 0.3s ease;
}

.widget-title-link:hover i {
    color: #e5e5e5;
}

.widget-link {
    color: #c0c0c0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget-link:hover {
    color: #e5e5e5;
}

.widget-content {
    color: #e5e5e5;
}

.widget-title-text {
    display: inline-block;
    font-size: 1.1em;
    font-weight: 700;
    color: #e5e5e5;
    margin: 0 auto;
}


/* Кнопка закрытия виджетной панели */
.widgets-close-btn {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e5e5;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin: 0;
    order: -1;
}

.widgets-close-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    transform: translateY(-2px);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.widgets-close-btn:active {
    transform: translateY(0) scale(0.98);
}

.widgets-close-btn .widget-header {
    margin-bottom: 0;
    justify-content: center;
    font-size: 0.95rem;
}

.widgets-close-btn .widget-header i {
    margin-right: 10px;
    color: #e5e5e5;
    transition: transform 0.3s ease;
    font-size: 0.525rem;
    align-self: center;
    width: auto;
    height: auto;
    line-height: 1;
    display: inline-block;
}

.widgets-close-btn:hover .widget-header i {
    transform: rotate(90deg);
    color: #fff;
}

/* Виджет часов */
.clock-widget .current-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: #c0c0c0;
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.clock-widget .current-date {
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.8;
    color: #e5e5e5;
}

/* Виджет заметок */
.notes-widget {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.notes-widget .notes-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.notes-widget .stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notes-widget .stat-number {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #c0c0c0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.notes-widget .stat-label {
    font-size: 0.675rem;
    opacity: 0.7;
    color: #e5e5e5;
}

.notes-widget .recent-notes {
    max-height: 280px;
    overflow-y: auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Стилизация скроллбара для списка заметок */
.notes-widget .recent-notes::-webkit-scrollbar {
    width: 6px;
}

.notes-widget .recent-notes::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.notes-widget .recent-notes::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.notes-widget .recent-notes::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.notes-widget .note-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    border-left: 3px solid #c0c0c0;
    transition: all 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-height: 40px;
    display: block !important;
}

.notes-widget .note-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #e5e5e5;
}

.notes-widget .clickable-note {
    cursor: pointer;
    transition: all 0.3s ease;
}

.notes-widget .clickable-note:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
    transform: translateX(3px);
}

/* Priority Colors */
.notes-widget .note-item.priority-low {
    border-left-color: #6c757d;
}

.notes-widget .note-item.priority-medium {
    border-left-color: #17a2b8;
}

.notes-widget .note-item.priority-high {
    border-left-color: #ffc107;
}

.notes-widget .note-item.priority-urgent {
    border-left-color: #dc3545;
}

.notes-widget .note-item.priority-low:hover {
    border-left-color: #7a8690;
}

.notes-widget .note-item.priority-medium:hover {
    border-left-color: #1cbccf;
}

.notes-widget .note-item.priority-high:hover {
    border-left-color: #ffd43b;
}

.notes-widget .note-item.priority-urgent:hover {
    border-left-color: #e74c3c;
}

.notes-widget .note-item:last-child {
    margin-bottom: 0;
}

.notes-widget .note-title {
    font-weight: 600;
    margin-bottom: 2px;
    color: #e5e5e5;
    font-size: 0.585rem;
    line-height: 1.2;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.notes-widget .note-date {
    font-size: 0.676rem;
    opacity: 0.6;
    color: #c0c0c0;
    line-height: 1.1;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.notes-widget .loading {
    text-align: center;
    opacity: 0.7;
    font-style: italic;
    color: #c0c0c0;
}

/* Виджет быстрых действий */
.actions-widget {
    display: block !important;
    visibility: visible !important;
}

.actions-widget .quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.actions-widget .quick-action {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 10px;
    padding: 15px 10px;
    text-decoration: none;
    color: #e5e5e5;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.actions-widget .quick-action:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.actions-widget .quick-action i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #c0c0c0;
}

.actions-widget .quick-action:hover i {
    color: #e5e5e5;
}

.actions-widget .quick-action span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Overlay */
.widgets-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .widgets-trigger {
        right: 10px;
        padding: 15px 6px 15px 12px;
        min-height: 80px;
        /* Улучшаем видимость на мобильных */
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
        border: 2px solid #555;
        /* Увеличиваем область касания */
        min-width: 60px;
    }
    
    .widgets-trigger .trigger-icon {
        font-size: 1.4rem;
        /* Делаем иконку более заметной */
        color: #e0e0e0;
    }
    
    .widgets-trigger .trigger-text {
        font-size: 0.8rem;
    }
    
    /* Улучшаем hover эффекты для мобильных */
    .widgets-trigger:hover {
        transform: translateY(-50%) translateX(-6px);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8);
        background: linear-gradient(135deg, #4a4a4a 0%, #3c3c3c 100%);
        border-color: #777;
    }
    
    .widgets-panel {
        width: 100%;
        right: -100%;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }
    
    .widgets-content {
        padding: 15px;
        gap: 15px;
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .widgets-close-btn {
        padding: 10px 12px;
    }
    
    .widgets-close-btn .widget-header {
        font-size: inherit;
    }
    
    .widgets-close-btn .widget-header i {
        font-size: 0.45rem;
        margin-right: 8px;
    }
    
    .widgets-close-btn .widget-title-text {
        font-size: 0.9em;
    }
    
    .widget {
        padding: 12px;
        min-height: auto;
    }
    
    .widget-header {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .widget-title-text {
        font-size: 1em;
    }
    
    .actions-widget .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .actions-widget .quick-action {
        padding: 12px;
    }
    
    .actions-widget .quick-action i {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .actions-widget .quick-action span {
        font-size: 0.85rem;
    }
    
    .notes-widget .recent-notes {
        max-height: 200px;
    }
    
    .clock-widget .current-time {
        font-size: 2rem;
    }
    
    .clock-widget .current-date {
        font-size: 1rem;
    }
    
    .notes-widget .stat-number {
        font-size: 1.2rem;
    }
    
    .notes-widget .stat-label {
        font-size: 0.65rem;
    }
    
    .notes-widget .note-item {
        padding: 8px;
    }
    
    .notes-widget .note-title {
        font-size: 0.75rem;
    }
    
    .notes-widget .note-date {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .widgets-trigger {
        right: 5px;
        padding: 12px 5px 12px 10px;
        min-height: 70px;
        /* Еще больше улучшаем видимость на маленьких экранах */
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
        border: 2px solid #666;
        min-width: 55px;
    }
    
    .widgets-trigger .trigger-icon {
        font-size: 1.3rem;
        color: #f0f0f0;
    }
    
    .widgets-panel {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }
    
    .widgets-content {
        height: calc(100vh - 55px);
        padding: 10px;
        overflow-y: auto;
        gap: 10px;
    }
    
    .widgets-close-btn {
        padding: 8px 10px;
    }
    
    .widgets-close-btn .widget-header {
        font-size: inherit;
    }
    
    .widgets-close-btn .widget-title-text {
        font-size: 0.85em;
    }
    
    .widgets-close-btn .widget-header i {
        font-size: 0.4rem;
        margin-right: 6px;
    }
    
    .widget {
        padding: 10px;
        border-radius: 12px;
    }
    
    .widget-header {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .widget-title-text {
        font-size: 0.95em;
    }
    
    .clock-widget .current-time {
        font-size: 1.8rem;
    }
    
    .clock-widget .current-date {
        font-size: 0.9rem;
    }
    
    .calendar-widget .calendar-current-date {
        font-size: 1.3rem;
    }
    
    .notes-widget .recent-notes {
        max-height: 150px;
    }
    
    .notes-widget .stat-number {
        font-size: 1.1rem;
    }
    
    .notes-widget .stat-label {
        font-size: 0.6rem;
    }
    
    .actions-widget .quick-action {
        padding: 10px;
    }
    
    .actions-widget .quick-action i {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .actions-widget .quick-action span {
        font-size: 0.8rem;
    }
    
    .notes-widget .note-item {
        padding: 6px;
    }
    
    .notes-widget .note-title {
        font-size: 0.7rem;
    }
    
    .notes-widget .note-date {
        font-size: 0.65rem;
    }
} 