/* Базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #0d1117;
    color: #e6edf3;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app {
    max-width: 1200px;
    width: 100%;
    background: #161b22;
    border-radius: 16px;
    border: 1px solid #30363d;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* Шапка */
.header {
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid #30363d;
    margin-bottom: 25px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #58a6ff, #f0883e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #8b949e;
    font-size: 14px;
    margin-top: 5px;
}

/* Основная сетка */
.main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Ввод текста */
.input-section label,
.output-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e6edf3;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background: #0d1117;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

textarea[readonly] {
    background: #0d1117;
    color: #c9d1d9;
}

/* Статистика */
.stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: #8b949e;
    flex-wrap: wrap;
}

.stats strong {
    color: #e6edf3;
}

/* Панель инструментов */
.tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: #0d1117;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #30363d;
}

.tools-group h3 {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.buttons {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    flex-basis: 90px;
    gap: 8px;
}

.buttons button {
    padding: 8px 16px;
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.buttons button:hover {
    background: #30363d;
    border-color: #58a6ff;
    transform: translateY(-1px);
}

.buttons button:active {
    transform: scale(0.97);
}

.buttons button.primary {
    background: #238636;
    border-color: #238636;
}

.buttons button.primary:hover {
    background: #2ea043;
}

.buttons button.danger {
    background: #da3633;
    border-color: #da3633;
}

.buttons button.danger:hover {
    background: #f85149;
}

/* Результат */
.output-section {
    margin-top: 10px;
}

.output-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.output-controls button {
    padding: 8px 20px;
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.output-controls button:hover {
    background: #30363d;
}

/* Подвал */
.footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
    text-align: center;
    font-size: 13px;
    color: #8b949e;
}

/* Адаптивность */
@media (max-width: 768px) {
    .app {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .tools {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .buttons button {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    textarea {
        min-height: 100px;
        font-size: 14px;
    }
    
    .stats {
        font-size: 12px;
        gap: 12px;
    }
}

/* Только для мобилок */

.details-mob {
    
}

.details-mob summary {
    font-size: 20px;
    margin-bottom: 7px;
    user-select: none;
}


/*Для модального окна*/

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgb(55, 48, 48);
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-close {
    float: right;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
}

.modal-close:hover {
    color: #aa0c0c;
}

#repeatCount {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-modal {
    padding: 8px 16px;
    background: #3a1516;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.button-modal:hover {
    background-color: #6a1c1f;
}
