/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

/* Экраны */
.screen {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Логотип */
.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 50px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Заголовок */
h1 {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 15px;
}

/* Приветствие */
.greeting {
    text-align: center;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Описание */
.description {
    text-align: center;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Список преимуществ */
.benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.benefits li {
    padding: 8px 15px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #444;
}

/* Фичи */
.features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    min-width: 100px;
}

.feature-icon {
    font-size: 24px;
}

.feature span:last-child {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Кнопки */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon {
    font-size: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* Счётчик */
.counter {
    text-align: center;
    color: #999;
    font-size: 14px;
}

#usage-count {
    font-weight: 700;
    color: #667eea;
}

/* Анимация построения схемы */
.diagram-builder {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 0 auto 20px;
}

.diagram-builder .block {
    position: absolute;
    width: 35px;
    height: 25px;
    border-radius: 5px;
    animation: blockAppear 2s ease-in-out infinite;
}

.block-1 {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    top: 10px;
    left: 42px;
    animation-delay: 0s !important;
}

.block-2 {
    background: #fff3e0;
    border: 2px solid #ff9800;
    top: 47px;
    left: 42px;
    animation-delay: 0.3s !important;
}

.block-3 {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    top: 84px;
    left: 42px;
    animation-delay: 0.6s !important;
}

.diagram-builder .arrow {
    position: absolute;
    width: 2px;
    height: 12px;
    background: #667eea;
    left: 59px;
}

.arrow-1 {
    top: 35px;
    animation: arrowAppear 2s ease-in-out infinite;
    animation-delay: 0.15s;
}

.arrow-2 {
    top: 72px;
    animation: arrowAppear 2s ease-in-out infinite;
    animation-delay: 0.45s;
}

@keyframes blockAppear {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes arrowAppear {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Экран схемы */
.diagram-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.diagram-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mini-block {
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.mini-arrow {
    color: #667eea;
    font-size: 16px;
}

.diagram-hint {
    margin-top: 15px;
    font-size: 12px;
    color: #999;
}

/* Кнопки скачивания */
.download-options {
    margin-bottom: 10px;
}

.download-label {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
}

.download-buttons {
    display: flex;
    gap: 10px;
}

.download-buttons .btn {
    flex: 1;
    font-size: 13px;
    padding: 12px 10px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 8px;
    color: #333;
}

.modal-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.star {
    font-size: 28px;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s;
}

.star.active,
.star:hover {
    opacity: 1;
    transform: scale(1.1);
}

#feedback-text {
    width: 100%;
    height: 80px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    resize: none;
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons .btn {
    flex: 1;
}

/* Экран саммари */
.success-icon {
    font-size: 50px;
    text-align: center;
    margin-bottom: 15px;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.summary-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-card h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.summary-section {
    margin-bottom: 15px;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h4 {
    color: #555;
    font-size: 14px;
    margin-bottom: 8px;
}

.summary-section ul,
.summary-section ol {
    margin: 0;
    padding-left: 20px;
}

.summary-section li {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
    line-height: 1.4;
}

/* Экран обработки */
.processing-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-waves {
    display: flex;
    gap: 5px;
    height: 40px;
    align-items: center;
}

.processing-waves span {
    width: 6px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    animation: wave 1.2s ease-in-out infinite;
}

.processing-waves span:nth-child(1) { animation-delay: 0s; }
.processing-waves span:nth-child(2) { animation-delay: 0.1s; }
.processing-waves span:nth-child(3) { animation-delay: 0.2s; }
.processing-waves span:nth-child(4) { animation-delay: 0.3s; }
.processing-waves span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 40px;
    }
}

.processing-text {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.step.active {
    background: #e8f4fd;
    border-left: 3px solid #667eea;
}

.step.done {
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
}

.step-icon {
    font-size: 18px;
}

.step-text {
    color: #555;
    font-size: 14px;
}

.step.done .step-text {
    color: #388e3c;
}

/* Лог обработки */
.processing-log {
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: background 0.2s;
}

.log-header:hover {
    background: #eee;
}

.log-arrow {
    transition: transform 0.3s;
}

.log-header.open .log-arrow {
    transform: rotate(180deg);
}

.log-content {
    display: none;
    padding: 0 15px 15px;
    border-top: 1px solid #e9ecef;
}

.log-content.open {
    display: block;
}

.log-timer,
.log-status {
    font-size: 12px;
    color: #555;
    margin-bottom: 8px;
}

.log-timer span,
.log-status span {
    font-weight: 600;
    color: #667eea;
}

.log-entries {
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 11px;
    background: #2d2d2d;
    color: #f0f0f0;
    border-radius: 6px;
    padding: 10px;
}

.log-entry {
    margin-bottom: 4px;
    line-height: 1.4;
}

.log-entry .time {
    color: #888;
}

.log-entry .msg {
    color: #4fc3f7;
}

.log-entry.error .msg {
    color: #ef5350;
}

.log-entry.success .msg {
    color: #66bb6a;
}

/* Кнопка назад */
.btn-back {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 0;
    margin-bottom: 20px;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Экран записи */
.record-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.record-icon.recording {
    animation: pulse-record 1s infinite;
    color: #e53935;
}

@keyframes pulse-record {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

h2 {
    text-align: center;
    color: #333;
    font-size: 22px;
    margin-bottom: 15px;
}

.record-status {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.record-status.recording {
    color: #e53935;
    font-weight: 600;
}

.record-timer {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    font-family: monospace;
}

.btn-record {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: white;
    width: 100%;
}

.btn-record:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(229, 57, 53, 0.4);
}

.btn-stop {
    background: #333;
    color: white;
    width: 100%;
}

.btn-stop:hover {
    background: #555;
}

#recorded-audio-container {
    margin-top: 25px;
    text-align: center;
}

#recorded-audio {
    width: 100%;
    margin: 15px 0;
}

/* Экран загрузки */
.upload-icon {
    font-size: 50px;
    text-align: center;
    margin-bottom: 20px;
}

.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.file-drop-zone p {
    color: #666;
    margin: 5px 0;
}

.file-drop-zone .small {
    font-size: 12px;
    color: #999;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.file-icon {
    font-size: 30px;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.file-size {
    font-size: 12px;
    color: #999;
}

.btn-remove-file {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.btn-remove-file:hover {
    color: #e53935;
}

/* Адаптивность */
@media (max-width: 400px) {
    .screen {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .features {
        gap: 10px;
    }
    
    .feature {
        min-width: 80px;
        padding: 10px;
    }
}
