* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Колонки */
.left-column {
    width: 200px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px;
}

.center-column {
    flex: 1;
    background-color: #ffffff;
    padding: 20px;
    overflow-y: auto;
}

.right-column {
    width: 200px;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    padding: 20px;
}

/* Кнопки */
.btn-start {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-start:hover {
    background-color: #0056b3;
}

.btn-new-cv {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    float: right;
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 1200px;
    min-height: 500px;
    padding: 30px;
    position: relative;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Таблица шаблонов */
.templates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.templates-table th,
.templates-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.templates-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.templates-table tr:hover {
    background-color: #f5f5f5;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #28a745;
    color: white;
}

.btn-primary:hover {
    background-color: #28a745;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

/* Drag & Drop */
.drop-zone {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.drop-zone:hover {
    background-color: #f0f8ff;
}

.drop-zone.dragover {
    background-color: #e7f3ff;
}

/* Иконки */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.icon-plus::after {
    content: "➕";
}

.icon-edit::after {
    content: "✏️";
}

.icon-delete::after {
    content: "🗑️";
}

.icon-view::after {
    content: "👁️";
}

/* Секции в основном шаблоне */
.section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fafafa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: white;
    position: relative;
}

.item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Видео плеер */
.video-player-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.custom-video-player {
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-controls {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background-color: #555;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #007bff;
    border-radius: 2px;
}

.volume-slider {
    width: 80px;
}

/* Календарь */
.calendar-container {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
}

.calendar-day:hover {
    background-color: #f0f0f0;
}

.calendar-day.selected {
    background-color: #007bff;
    color: white;
}

.calendar-day.header {
    font-weight: 600;
    background-color: #f8f9fa;
    cursor: default;
}

/* Файлы */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
}

.file-icon {
    margin-right: 10px;
    font-size: 24px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    word-break: break-all;
}

.file-size {
    font-size: 12px;
    color: #666;
}



/* Модальные окна с прокруткой */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 1200px;
    min-height: 300px;
    max-height: 85vh;
    padding: 30px;
    position: relative;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.modal-body {
    margin-bottom: 20px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}

/* Стилизация скроллбара для модальных окон */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.modal-footer {
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: right;
    flex-shrink: 0;
}

/* Анимация появления модального окна */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* Для небольших экранов */
@media (max-height: 700px) {
    .modal-overlay {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }
    
    .modal-overlay {
        padding: 10px;
    }
}

/* Контейнеры секций в модальных окнах */
.sections-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 15px 0;
}

.section {
    margin-bottom: 25px;
    padding: 25px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background-color: #fcfcfc;
    transition: all 0.3s ease;
}

.section:hover {
    border-color: #d0d0d0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Элементы секций */
.section-item {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    position: relative;
    transition: all 0.2s ease;
}

.section-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.1);
}

.item-content {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 10px;
    padding-right: 40px;
}

.item-date {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-top: 8px;
    padding: 5px 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    display: inline-block;
}

.item-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

/* Кнопки в модальных окнах */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-modal {
    padding: 12px 25px;
    font-size: 15px;
    border-radius: 8px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.btn-modal-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
}

.btn-modal-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-modal-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-modal-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* Формы в модальных окнах */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group-modal {
    margin-bottom: 0;
}

.form-control-modal {
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control-modal:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* Календарь в модальном окне */
.calendar-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    max-height: 70vh;
    overflow-y: auto;
}

/* Видео превью в модальных окнах */
.video-preview-container {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.video-preview-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

/* Состояние загрузки */
.uploading-state {
    opacity: 0.7;
    pointer-events: none;
}

/* Уведомления в модальных окнах */
.modal-alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.modal-alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.modal-alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}



/* Стили для временных блоков */
.section-item {
    padding: 15px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.section-item:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.item-number {
    font-weight: bold;
    color: #495057;
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-actions .btn {
    padding: 3px 8px;
    font-size: 12px;
}

.item-content {
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}

.item-date {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #dee2e6;
}

.section-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-item {
    animation: fadeIn 0.3s ease-out;
}

/* Кнопки состояния */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Спиннер загрузки */
.spinner-border {
    vertical-align: middle;
    margin-right: 5px;
}

/* Уведомления */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Прогресс бар */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background-color: #007bff;
    transition: width 0.3s ease;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

/* Чекбокс для "По настоящее время" */
.form-check {
    user-select: none;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

/* Состояние кнопки сохранения */
#saveTemplateBtn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
}

#saveTemplateBtn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .item-actions {
        align-self: flex-end;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px !important;
    }
}

.cv-right-column { width: 200px; }