* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

.section {
    padding: 30px;
}

.hidden {
    display: none !important;
}

/* Форма пароля */
.password-form {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.password-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.password-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.password-form input:focus {
    outline: none;
    border-color: #667eea;
}

.password-form button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.password-form button:hover {
    background: #5568d3;
}

/* Статус сообщение */
.status-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Форма группа */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Информация о версии */
.version-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
}

.version-header button {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.version-header button:hover {
    background: #218838;
}

/* Зона загрузки */
.upload-section {
    margin-bottom: 30px;
}

.upload-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.upload-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.upload-area {
    border: 3px dashed #d0d0d0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-area p {
    color: #666;
    margin-bottom: 15px;
}

.upload-area button {
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-area button:hover {
    background: #5568d3;
}

/* Предпросмотр */
.preview-section {
    margin-top: 30px;
}

.preview-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#preview-table {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.preview-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    border-bottom: 1px solid #e0e0e0;
}

.preview-row:last-child {
    border-bottom: none;
}

.preview-row:nth-child(even) {
    background: #f8f9fa;
}

.preview-locale {
    padding: 15px;
    font-weight: 600;
    color: #667eea;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.preview-text {
    padding: 15px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Сообщения */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

/* Загрузка */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ТАБЫ ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9ff;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== СЕЛЕКТОР ПЛАТФОРМЫ ===== */
.platform-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.platform-btn {
    flex: 1;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.platform-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.platform-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    color: #667eea;
}

.platform-section {
    margin-bottom: 20px;
}

.platform-section.hidden {
    display: none;
}

/* ===== ANDROID SETUP ===== */
.android-setup-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.android-setup-info h4 {
    margin-bottom: 15px;
    color: #856404;
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setup-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.setup-step p {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

/* ===== КНОПКА ПАРСИНГА ===== */
.btn-parse {
    margin-top: 10px;
    padding: 12px 25px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-parse:hover {
    background: #138496;
}

/* ===== ДЕРЕВО СКРИНШОТОВ ===== */
#screenshots-tree {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.locale-group {
    margin-bottom: 15px;
}

.locale-header {
    font-weight: 600;
    color: #667eea;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.resolution-group {
    margin-left: 20px;
    margin-bottom: 10px;
}

.resolution-header {
    font-weight: 500;
    color: #333;
    padding: 5px 0;
}

.screenshot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 20px;
    margin-top: 5px;
}

.screenshot-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #666;
}

.screenshot-item.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ===== SUMMARY BOX ===== */
.summary-box {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

#screenshots-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

/* ===== ПРОГРЕСС БАР ===== */
.progress-section {
    margin-top: 20px;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

#progress-text {
    text-align: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.progress-log {
    background: #1e1e1e;
    color: #00ff00;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.progress-log .log-entry {
    margin-bottom: 5px;
}

.progress-log .log-success {
    color: #00ff00;
}

.progress-log .log-error {
    color: #ff6b6b;
}

.progress-log .log-info {
    color: #4dabf7;
}

/* ===== INFO TEXT ===== */
.info-text {
    color: #856404;
    background: #fff3cd;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 15px;
}

/* ===== CODE ===== */
code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

/* ===== PACKAGE SELECTOR ===== */
.package-selector {
    display: flex;
    gap: 10px;
}

.package-selector select {
    flex: 1;
}

.btn-add {
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-add:hover {
    background: #218838;
}

/* ===== CREDENTIALS ROW ===== */
.credentials-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.credentials-status {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credentials-icon {
    font-size: 20px;
}

#credentials-text {
    color: #666;
    font-size: 14px;
}

.credentials-row.loaded {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.credentials-row.loaded #credentials-text {
    color: #155724;
}

.btn-credentials {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-credentials:hover {
    background: #5568d3;
}

.btn-settings {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-settings:hover {
    background: #f0f0f0;
    border-color: #ccc;
}
