/* Боковая панель настроек */
.settings-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-right: 10px;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.settings-panel.open {
    right: 0;
}

.settings-panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: var(--white);
}

.settings-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
}

.settings-panel-header h3 i.fa-cog {
    color: var(--white);
}

.settings-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.settings-close:hover {
    background: rgba(255,255,255,0.2);
}

.settings-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: var(--dark);
}

.color-option.active {
    border-color: var(--dark);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--dark);
}

.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.custom-color-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-color-input label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

.custom-color-input input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.custom-color-input input[type="color"]:hover {
    border-color: var(--primary);
}

.contrast-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contrast-control label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-size: 14px;
    color: var(--gray);
}

.contrast-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--light);
    outline: none;
    -webkit-appearance: none;
}

.contrast-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.contrast-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.contrast-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.contrast-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.contrast-value {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    padding: 8px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: hidden;
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Анимации для уведомлений */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Анімації для повідомлень, що з'являються справа вгорі */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Анімації для повідомлень, що з'являються знизу (для сумісності) */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Предотвращение горизонтального скролла */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

#mainContent {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Адаптивность */
@media (max-width: 768px) {
    .settings-panel {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }
}
