/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    min-height: 100vh;
    background-color: #f4f6f9;
    color: #333;
}

/* Боковая панель */
.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
    text-align: center;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 30px;
    font-size: 20px;
    color: #3498db;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 12px 20px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.sidebar a:hover {
    background-color: #34495e;
    color: #3498db;
}

.sidebar a.active {
    background-color: #34495e;
    font-weight: 500;
}

/* Основное содержимое */
.main-content {
    margin-left: 260px;
    padding: 40px;
    width: calc(100% - 260px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /*background-color: #f4f6f9;*/
    background-image: url('../static/bg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height:100vh;
}

/* Стили для формы авторизации когда она одна */
.auth-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: opacity 0.3s ease;
}

.auth-container.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.auth-container h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

.auth-container p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4a90e2;
}

.btn, .upload-btn, .submit-btn {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 5px 5px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    width: 25%;
    transition: background-color 0.3s ease;
}

.buttons-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn:hover, .upload-btn:hover, .submit-btn:hover {
    background-color: #3a7bc8;
}

.forgot-password {
    margin-top: 15px;
    font-size: 14px;
}

.forgot-password a {
    color: #4a90e2;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Стили для контентного контейнера */
#content-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Стили для отдельных секций */
.content-section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    padding: 40px;
    text-align: left;
}

.content-section.active {
    display: block;
}

.content-section h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

.content-section p {
    color: #555;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.content-section ul {
    margin: 20px 0;
    padding-left: 20px;
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.content-section strong {
    color: #333;
}

.content-section pre {
    background-color: #f0f0f0;
    border-left: 4px solid #4a90e2;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    white-space: pre-wrap;
    border-radius: 4px;
    font-size: 15px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
        padding: 20px;
    }
    .auth-container {
        padding: 30px 20px;
    }
    .content-section {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .main-content .auth-container {
        display: none;
    }
    .content-section {
        padding: 20px;
    }
    .content-section h1 {
        font-size: 22px;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background-color: #dc3545;
}

/* Блок загрузки файла */
.upload-section, .input-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.upload-section h2, .input-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.upload-form, .data-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.input-label {
    font-weight: 600;
    color: #555;
}

.data-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.result-area {
    margin-top: 20px;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.result-output {
    color: #2c3e50;
    margin: 0;
    min-height: 20px;
    white-space: pre-wrap;
    word-break: break-all;
}

.paragraph {
    text-indent: 1.5em;
    margin-bottom: 1.2em;
    text-align: justify;
}

.highlight {
    font-weight: bold;
    color: #2980b9;
}

/* Стили для секции логов */
.logs-section {
    background-color: white;
    border-radius: 8px;
    padding: 0;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logs-header:hover {
    background-color: #e9ecef;
}

.logs-header h2 {
    margin: 0;
    color: #2c3e50;
    border-bottom: none;
    padding-bottom: 0;
}

.collapse-btn {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.collapse-btn:hover {
    background-color: #dee2e6;
    color: #495057;
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.collapse-btn.collapsed .collapse-icon {
    transform: rotate(0deg);
}

.collapse-btn:not(.collapsed) .collapse-icon {
    transform: rotate(180deg);
}

.logs-content {
    padding: 20px;
    transition: all 0.3s ease;
}

.logs-content.show {
    display: block !important;
}

.refresh-logs-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 15px;
}

.refresh-logs-btn:hover {
    background-color: #218838;
}

.refresh-logs-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.logs-container {
    margin-top: 10px;
}

.logs-output {
    width: 100%;
    height: 400px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    white-space: pre;
    overflow: auto;
    color: #2c3e50;
}

.logs-output:focus {
    outline: none;
    border-color: #3498db;
}

/* Стили для состояния загрузки */
.logs-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Адаптивность для логов */
@media (max-width: 768px) {
    .logs-output {
        height: 300px;
        font-size: 13px;
    }

    .refresh-logs-btn {
        width: 100%;
        padding: 12px;
    }

    .logs-header {
        padding: 15px;
    }

    .logs-header h2 {
        font-size: 18px;
    }
}