* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.info-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.info-box h3 {
    color: #333;
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.char-counter {
    text-align: right;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f0f0f0;
}

.upload-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
}

.upload-prompt p {
    margin: 5px 0;
    color: #666;
}

.file-limits {
    font-size: 0.9em;
    color: #999;
}

.file-list {
    margin-top: 15px;
}

.file-item {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item .remove-file {
    color: #ff4444;
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loader-container {
    text-align: center;
    padding: 40px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.results {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-card.success {
    border-left: 4px solid #00c851;
}

.result-card.error {
    border-left: 4px solid #ff4444;
}

.result-card .filename {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.result-card .payload {
    background: #f0f0f0;
    padding: 8px;
    border-radius: 5px;
    font-family: monospace;
    margin: 10px 0;
}

.result-card .download-link {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
    transition: background 0.3s;
}

.result-card .download-link:hover {
    background: #5a6fd8;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.95em;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.small {
    font-size: 0.85em;
    opacity: 0.8;
    margin-top: 10px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .container {
        border-radius: 10px;
    }

    .tab-content {
        padding: 20px;
    }
}

/* Прелоадер страницы */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-content .loader {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    margin: 0 auto 20px;
}

.loader-content p {
    font-size: 1.2em;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Скелетон загрузки */
.skeleton-loader {
    padding: 30px;
    background: white;
}

.tabs-skeleton {
    display: flex;
    gap: 2px;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 10px 10px 0 0;
}

.skeleton-tab {
    flex: 1;
    height: 50px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

.content-skeleton {
    padding: 30px;
    background: white;
    border-radius: 0 0 10px 10px;
}

.skeleton-box {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 20px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Оптимизация для Raspberry Pi */
@media (prefers-reduced-motion: reduce) {

    .loader,
    .skeleton-box,
    .skeleton-tab {
        animation: none;
    }
}

/* Уменьшаем анимации на слабых устройствах */
@media (max-width: 768px) {
    .btn-primary:hover:not(:disabled) {
        transform: none;
    }

    .file-upload-area:hover {
        transform: none;
    }
}

/* Статистика */
.stats-widget {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    line-height: 1;
}

/* Анимация обновления статистики */
.stat-value.updating {
    animation: statPulse 0.5s ease;
}

@keyframes statPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        color: #ffd700;
    }
}

/* SEO текст */
.seo-content {
    background: #f8f9fa;
    padding: 40px 30px;
    margin-top: 40px;
    border-radius: 20px;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.seo-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.seo-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.seo-card ul {
    list-style-type: none;
    padding: 0;
}

.seo-card li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.seo-card li:before {
    content: "✓";
    color: #667eea;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.seo-faq {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h4 {
    color: #333;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item h4:after {
    content: "▼";
    font-size: 0.8em;
    color: #667eea;
    transition: transform 0.3s;
}

.faq-item.active h4:after {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 10px 0;
    color: #666;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .stats-widget {
        gap: 15px;
        border-radius: 20px;
        padding: 10px;
    }

    .stat-item {
        flex: 1 1 calc(50% - 30px);
    }

    .stat-value {
        font-size: 1.4em;
    }
}