/* timestampModalStyles.css */

/* Базові стилі для модальних вікон */
#timestamp-modal,
.timestamp-input-modal,
.files-list-modal,
.file-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1085; /*9999;*/
    justify-content: center;
    align-items: center;
   /* opacity: 0.4;  90% прозорості для всього елемента */
}

/* Специфічні z-index для різних модальних вікон */
.timestamp-input-modal,
.files-list-modal {
    z-index: 1090;/*10000;*/
}

.file-preview-modal {
    z-index: 1095;/*11000;*/
}

/* Стилі для контенту модальних вікон */
#timestamp-modal .modal-content,
.timestamp-input-content,
.files-list-content,
.file-preview-content {
    position: relative;
    background: white;
    background: rgba(255,255,255, 0.2);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.files-list-content {
   background: white; 
}

.timestamp-input-content {
    max-width: 400px;
}

.files-list-content {
    max-width: 600px;
    max-height: 80vh;
}

.file-preview-content {
    max-width: 800px;
    max-height: 80vh;
}

/* Анімація появи */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стилі для заголовків */
#timestamp-modal h2,
.timestamp-input-content h3,
.files-list-content h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    font-size: 1.5em;
}

/* Кнопка закриття */
.modal-closeTimeStamp-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(96, 2, 2, 0.88);
    border: none;
    cursor: pointer;
    color: #f0d507;
    z-index: 1000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    padding: 0;
}

.modal-closeTimeStamp-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}

.modal-closeTimeStamp-btn:hover {
    background: rgba(4, 110, 24, 0.976);
    color: #333;
    transform: rotate(90deg);
}
/*
.modal-close-btn {
    
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #f0d507;
    z-index: 1000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    background: rgba(96, 2, 2, 0.88);
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
     background: rgba(4, 110, 24, 0.976);
    color: #333;
    transform: rotate(90deg);
}
*/
/* Кнопка перегляду файлів */
#view-timestamp-files-btn {
    position: absolute;
    top: 10px;
    left: 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;  /* збільшено внутрішні відступи */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;  /* збільшено проміжок між зображенням і текстом */
    font-size: 15px;  /* трохи збільшено шрифт */
    font-weight: 500;  /* додано напівжирний */
    min-width: 140px;  /* мінімальна ширина */
    width: auto;  /* автоматична ширина */
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);  /* додано тінь для кращого вигляду */
}

#view-timestamp-files-btn img {
    width: 24px;  /* трохи збільшено зображення */
    height: 24px;
    object-fit: contain;
}

/* Додамо ефект при наведенні */
#view-timestamp-files-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Додамо ефект при натисканні */
#view-timestamp-files-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

/* Стилі для дисплею таймера */
.timer-display {
    display: block !important;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
  /*  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg, #66c0ea 0%, #0ea6ec 100%, 0.2);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    word-break: break-word;
}

/* Стилі для статусу запису */
.record-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 10px;
    background: rgb(41, 134, 204, 0.2); /* #f5f5f5;*/
    border-radius: 5px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.3s;
}

.status-indicator.recording {
    background-color: #f44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Стилі для кнопок керування таймером */
.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.timestamp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    min-height: 50px;
}

.timestamp-btn-primary {
   /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #0a9ee3 0%, #075b82 100%);
    color: white;
}

.timestamp-btn-pause {
   /* 
    background: linear-gradient(135deg, #0a9ee3 0%, #075b82 100%);*/
    background: linear-gradient(135deg, orange 0% ,rgb(168, 109, 2) 100%);
    color: white;
}

.timestamp-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.timestamp-btn-info {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.timestamp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.timestamp-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.timestamp-btn img {
    width: 20px;
    height: 20px;
}

/* Стилі для сітки таймстемпів */
.timestamps-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgb(245, 245, 245, 0.1);
   
    border-radius: 5px;
}

.timestamp-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: rgb(255, 243, 205, 0.1);
    border-radius: 5px;
    border-left: 4px solid #4CAF50;
}

.timestamp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.timestamp-index {
    font-weight: bold;
    color: #4CAF50;
    font-size: 14px;
}

.timestamp-time {
    font-family: monospace;
    font-size: 14px;
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.timestamp-note {
    font-size: 14px;
    word-break: break-word;
    color: #333;
    padding: 5px 0;
    line-height: 1.4;
}

.timestamp-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: all 0.3s;
    align-self: flex-end;
    color: #f44336;
    font-size: 18px;
    border-radius: 4px;
}

.timestamp-delete:hover {
    opacity: 1;
    background: rgba(244, 67, 54, 0.1);
}

/* Стилі для списку міток */
.timestamp-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgb(249, 249, 249, 0.1);
    
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.timestamp-hint {
    font-size: 12px;
    margin-top: 5px;
    color: #ccc;
}

/* Стилі для поля вводу тексту */
.timestamp-input-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 20px;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

.timestamp-input-content textarea:focus {
    border-color: #4CAF50;
    outline: none;
}

/* Стилі для кнопок в модальному вікні вводу */
.timestamp-input-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timestamp-input-buttons button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s;
}

.timestamp-input-buttons .confirm-btn {
    background: #4CAF50;
    color: white;
}

.timestamp-input-buttons .confirm-btn:hover {
    background: #45a049;
}

.timestamp-input-buttons .cancel-btn {
    background: #f44336;
    color: white;
}

.timestamp-input-buttons .cancel-btn:hover {
    background: #da190b;
}

/* Стилі для елементів списку файлів */
.file-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    font-family: monospace;
    font-size: 14px;
    word-break: break-word;
    color: #333;
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.file-view-btn,
.file-download-btn {
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s;
}

.file-view-btn {
    background: #2196F3;
    color: white;
}

.file-download-btn {
    background: #4CAF50;
    color: white;
}

.file-view-btn:hover,
.file-download-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Стилі для попереднього перегляду файлів */
.file-preview-content pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    max-height: 500px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Стилі для попередження */
.warning-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    color: #856404;
    margin: 10px 0;
    font-size: 14px;
}

/* Медіа-запити для різних розмірів екранів */

/* Маленькі телефони (до 320px) */
@media (max-width: 320px) {
    #timestamp-modal .modal-content,
    .timestamp-input-content,
    .files-list-content,
    .file-preview-content {
        padding: 15px;
        width: 95%;
    }
    
    .timer-display {
        font-size: 32px;
        padding: 15px;
    }
    
    .timestamp-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    #view-timestamp-files-btn {
        right: 45px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    #view-timestamp-files-btn img {
        width: 16px;
        height: 16px;
    }
    
    .timestamp-item {
        padding: 10px;
    }
}

/* Телефони середнього розміру (321px - 480px) */
@media (min-width: 321px) and (max-width: 480px) {
    .timer-display {
        font-size: 40px;
    }
    
    .timestamp-btn {
        padding: 14px 20px;
    }
    
    .file-item {
        padding: 12px;
    }
}

/* Великі телефони та маленькі планшети (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .timer-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .timestamp-btn {
        width: calc(50% - 5px);
    }
    
    .file-actions {
        flex-direction: row;
    }
    
    .timestamp-item {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .timestamp-header {
        flex: 1;
    }
    
    .timestamp-delete {
        align-self: center;
    }
}

/* Планшети (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .timer-controls {
        flex-direction: row;
        gap: 15px;
    }
    
    .timestamp-btn {
        width: auto;
        min-width: 160px;
    }
    
    .file-actions {
        flex-direction: row;
        width: auto;
    }
    
    .file-view-btn,
    .file-download-btn {
        width: auto;
        min-width: 100px;
    }
    
    .timestamp-item {
        flex-direction: row;
        align-items: center;
    }
    
    .timestamp-header {
        flex: 2;
    }
    
    .timestamp-note {
        flex: 3;
    }
}

/* Десктопи (1025px і більше) */
@media (min-width: 1025px) {
    .timer-controls {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
    
    .timestamp-btn {
        width: auto;
        min-width: 180px;
    }
    
    .file-actions {
        flex-direction: row;
        width: auto;
    }
    
    .file-view-btn,
    .file-download-btn {
        width: auto;
        min-width: 120px;
    }
    
    .timestamp-item {
        flex-direction: row;
        align-items: center;
    }
    
    .timestamp-header {
        flex: 1;
    }
    
    .timestamp-note {
        flex: 3;
    }
}

/* Для дуже великих екранів (1440px і більше) */
@media (min-width: 1440px) {
    #timestamp-modal .modal-content {
        max-width: 1000px;
    }
    
    .timer-display {
        font-size: 56px;
    }
    
    .timestamp-btn {
        font-size: 18px;
        padding: 16px 32px;
    }
}

/* Ландшафтна орієнтація на мобільних пристроях */
@media (max-height: 500px) and (orientation: landscape) {
    #timestamp-modal .modal-content,
    .timestamp-input-content,
    .files-list-content,
    .file-preview-content {
        max-height: 85vh;
    }
    
    .timestamps-grid,
    .timestamp-list {
        max-height: 150px;
    }
    
    .timer-display {
        font-size: 32px;
        padding: 10px;
        margin: 10px 0;
    }
    
    .timestamp-btn {
        padding: 8px 12px;
    }
}

/* Стилі для друку */
@media print {
    #timestamp-modal,
    .timestamp-input-modal,
    .files-list-modal,
    .file-preview-modal {
        display: none !important;
    }
}

/* Стилі для індикатора завантаження DOWNLOAD ALL */
.download-all-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-progress {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.download-all-btn {
    background-color: #4CAF50 !important;
    color: white !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: background-color 0.3s !important;
}

.download-all-btn:hover {
    background-color: #45a049 !important;
}

.download-all-btn img {
    filter: brightness(0) invert(1) !important;
}