/* Общие стили страницы */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 0 20px 20px;
    margin: 0;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: white;
    color: #667eea;
}

/* Контейнер для селекта */
.select-container {
    max-width: 1200px;
    margin: 0 auto 30px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

/* Стили для селектов */
select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

select option {
    padding: 10px;
    font-size: 15px;
}

select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Кнопка скачивания */
.download-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

/* Контейнер для контента шаблона */
#template-content {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.template-placeholder-wrapper {
    display: inline-block;
    vertical-align: baseline;
    margin: 0 2px;
    position: relative;
}

.template-placeholder {
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    padding: 2px 4px;
    font-size: inherit;
    font-family: inherit;
    background: transparent;
    min-width: 150px;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    vertical-align: baseline;
    transition: width 0.2s ease, border-bottom-color 0.2s ease;
    text-align: center;
}

.template-placeholder:focus {
    outline: none;
    border-bottom: 2px solid #000;
    background: transparent;
}

.template-placeholder:hover {
    border-bottom-color: #333;
}

.template-placeholder::placeholder {
    color: #999;
    font-style: normal;
    text-align: center;
}

/* Стили для загрузки Word файлов */
.word-file-placeholder {
    display: inline-block;
    vertical-align: baseline;
    margin: 15px 0;
    padding: 15px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-width: 200px;
    transition: all 0.3s ease;
}

.word-file-placeholder:hover {
    border-color: #007bff;
    background: linear-gradient(135deg, #f0f7ff 0%, #e0efff 100%);
}

.word-file-upload-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.word-file-upload-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.word-file-upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.word-file-upload-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.word-file-upload-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

.word-file-content {
    margin-top: 10px;
    padding: 10px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    min-height: 50px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.word-file-loading {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

