/* Стили для Live режима */
:root {
    --live-primary: #ff3b5c;
    --live-secondary: #00b8ff;
    --live-dark: #121212;
    --live-light: #f8f8f8;
    --live-accent: #7331FF;
    --live-gradient: linear-gradient(135deg, #ff3b5c, #7331FF, #00b8ff);
}

/* Базовый контейнер Live режима */
.live-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-color: var(--live-dark);
    color: var(--live-light);
    overflow: hidden;
    position: relative;
}

/* Стили для верхней панели */
.live-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    padding: 20px;
}

.live-title {
    font-size: 48px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    letter-spacing: 10px;
    margin: 0;
    animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(1.2); }
    20% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.back-button {
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.back-button:hover {
    color: var(--live-primary);
}

.live-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-record, .btn-stream {
    background-color: transparent;
    border: 2px solid;
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-record {
    border-color: var(--live-primary);
    color: var(--live-primary);
}

.btn-record:hover, .btn-record.active {
    background-color: var(--live-primary);
    color: white;
}

.btn-stream {
    border-color: var(--live-secondary);
    color: var(--live-secondary);
}

.btn-stream:hover, .btn-stream.active {
    background-color: var(--live-secondary);
    color: white;
}

#settings-button {
    background-color: transparent;
    border: none;
    color: var(--live-light);
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#settings-button:hover {
    color: var(--live-accent);
    transform: rotate(45deg);
}

/* Основной контейнер с видео */
.live-main {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

#live-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 80vh;
    margin: 0 auto;
    background-color: #000;
}

/* Стили для отображения текста в режиме Live */
#lyrics-overlay {
    position: absolute;
    bottom: 20%;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 100;
    text-align: center;
    pointer-events: none;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.7);
}

/* Активная строка */
.live-active-line {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #4a148c, #7b1fa2, #e91e63, #f44336);
    background-size: 300% 300%;
    animation: live-gradient 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 10px;
    position: relative;
}

.live-active-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    z-index: -1;
}

/* Следующая строка */
.live-next-line {
    font-size: 2rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 8px;
    display: inline-block;
}

@keyframes live-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Эффект затемнения для лучшей читаемости текста */
#live-video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.2) 40%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.2) 60%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 101;
}

.effects-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 5;
}

.btn-effects {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid var(--live-accent);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-effects:hover {
    transform: scale(1.1);
    background-color: var(--live-accent);
}

.countdown-timer {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid var(--live-primary);
    font-size: 24px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
}

.recording-indicator {
    background-color: var(--live-primary);
    color: white;
    border-radius: 5px;
    padding: 5px 10px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
    display: none;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Панель с масками */
.masks-panel {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
    z-index: 10;
}

.masks-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--live-light);
}

.masks-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: thin;
}

.masks-categories::-webkit-scrollbar {
    height: 5px;
}

.masks-categories::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.masks-categories::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.category-btn {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn.active {
    background-color: var(--live-accent);
    box-shadow: 0 0 10px rgba(115, 49, 255, 0.5);
}

.category-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.25);
}

.masks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    overflow-y: auto;
    max-height: 150px;
    padding-right: 5px;
    scrollbar-width: thin;
}

.masks-container::-webkit-scrollbar {
    width: 5px;
}

.masks-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.masks-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.mask-item {
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px;
    width: 120px;
    height: 120px;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

.mask-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.mask-item.active {
    border-color: var(--live-accent);
    box-shadow: 0 0 15px var(--live-accent);
}

.mask-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.mask-item:hover img {
    opacity: 1;
}

.mask-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

/* Примеры стилей для предпросмотра масок */
.blur-preview {
    backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.1);
}

.vintage-preview {
    background-color: rgba(244, 226, 198, 0.3);
    position: relative;
}

.vintage-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 3px,
        rgba(0, 0, 0, 0.1) 3px
    );
}

.concert-preview {
    background: radial-gradient(circle, rgba(23, 13, 57, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%);
    position: relative;
}

.concert-preview::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, 
        transparent 48%, 
        rgba(255, 0, 128, 0.5) 48%, 
        rgba(255, 0, 128, 0.5) 52%, 
        transparent 52%);
    transform: rotate(45deg);
}

/* Модальное окно */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background-color: var(--live-dark);
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-container.hidden .modal {
    transform: translateY(50px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

#close-modal {
    background: transparent;
    border: none;
    color: var(--live-light);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#close-modal:hover {
    color: var(--live-primary);
    transform: scale(1.1);
}

.modal-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .live-header {
        padding: 5px 10px;
    }
    
    .live-title {
        font-size: 20px;
    }
    
    .btn-record, .btn-stream {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .live-active-line {
        font-size: 2rem;
    }
    
    .live-next-line {
        font-size: 1.5rem;
    }
    
    .masks-container {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .mask-preview {
        width: 50px;
        height: 50px;
    }
}

/* Класс для затемнения видео для лучшей видимости текста */
.dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.3) 0%,
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.5) 80%,
        rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}

/* Live Mode styles */
.style-live {
    background: rgba(0, 0, 0, 0.8);
}

.container-live {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#live-video-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#live-video-container.hidden {
    display: none;
}

#live-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 9001;
}

#recording-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
    border-radius: 50px;
    padding: 6px 15px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 9100;
    animation: pulse 1.5s infinite;
}

#recording-indicator:before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

#recording-indicator.hidden {
    display: none;
}

/* Masks panel styles */
#masks-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9300;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-in-out;
}

#masks-panel.hidden {
    display: none;
}

.masks-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.masks-header h2 {
    flex-grow: 1;
    text-align: center;
    color: white;
    font-size: 18px;
    margin: 0;
}

.back-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.category-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 20px;
    color: white;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn.active {
    background-color: #ff3366;
}

#masks-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-height: 350px;
    overflow-y: auto;
    padding: 0 10px 10px;
}

.mask-item {
    width: 80px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.mask-item:hover {
    transform: scale(1.05);
}

.mask-item.active {
    position: relative;
}

.mask-item.active:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background-color: #ff3366;
    border-radius: 50%;
}

.mask-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.mask-name {
    color: white;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal styles */
#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-container.hidden {
    display: none;
}

.modal-content {
    background-color: #222;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    overflow: hidden;
}

.modal-header {
    background-color: #333;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: white;
    margin: 0;
}

#close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    color: white;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group h4 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    opacity: 0.9;
}

.setting-item input,
.setting-item select {
    width: 100%;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    color: white;
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-primary {
    background-color: #ff3366;
    color: white;
}

.btn-secondary {
    background-color: #444;
    color: white;
}

/* Улучшенные стили для отображения текста */
.live-active-line {
    font-size: 36px;
    font-weight: 700;
    color: white;
    text-shadow: -1px -1px 1px rgba(0,0,0,0.8),
                  1px -1px 1px rgba(0,0,0,0.8),
                 -1px 1px 1px rgba(0,0,0,0.8),
                  1px 1px 1px rgba(0,0,0,0.8),
                  0 0 8px rgba(255,255,255,0.3);
    line-height: 1.4;
    margin: 0 auto;
    max-width: 85%;
}

.live-next-line {
    font-size: 28px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    line-height: 1.4;
    margin: 5px auto 0;
    max-width: 85%;
}

#live-lyrics-container {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 30px 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 9200;
    text-align: center;
}

/* Состояние скрытия */
.hidden {
    display: none !important;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .live-control-btn {
        min-width: 90px;
        height: 45px;
        font-size: 14px;
    }
    
    #live-header, .live-title {
        font-size: 34px;
    }
    
    .live-active-line {
        font-size: 28px;
    }
    
    .live-next-line {
        font-size: 22px;
    }
    
    #masks-container {
        max-height: 250px;
    }
    
    .live-control-button {
        font-size: 13px;
        padding: 6px 14px;
    }
}

/* Стили для уведомлений */
.camera-permission-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 20px;
    z-index: 9999;
    max-width: 90%;
    width: 400px;
    text-align: center;
}

.notification-content {
    color: white;
}

.notification-content p {
    margin-bottom: 15px;
}

#retry-camera-access {
    background-color: #ff3366;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: bold;
}

/* Новые стили для кнопок в режиме Live */
#live-controls-container {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9100;
}

.live-control-button {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 18px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.live-control-button:hover {
    background-color: rgba(0, 0, 0, 0.75);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.live-control-button:active {
    transform: translateY(0);
}

#live-rec-button {
    background-color: rgba(220, 53, 69, 0.8);
}

#live-rec-button.recording {
    animation: pulse 1.5s infinite;
}

#live-stream-button {
    background-color: rgba(13, 110, 253, 0.8);
}

#live-settings-button {
    background-color: rgba(33, 37, 41, 0.8);
}

#live-stop-button {
    background-color: rgba(220, 53, 69, 0.8);
}

/* Новый стиль для кнопки "Назад" в режиме Live */
#live-back-button {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    z-index: 9100;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

#live-back-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
} 