/* Yan Tools PHP Compressor - Styles */

.yan-tools-php-compressor {
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.yan-tools-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.yan-tools-header h2 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.yan-tools-header p {
   
    margin: 0;
    font-size: 16px;
}

/* Обертка для textarea с drag&drop */
.yan-tools-textarea-wrapper {
    position: relative;
}

.yan-tools-drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.1);
    border: 2px dashed #3498db;
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.yan-tools-drag-overlay.active {
    display: flex;
}

.yan-tools-drag-text {
    text-align: center;
    color: #3498db;
    font-size: 16px;
}

.yan-tools-upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Основной контент с двумя колонками */
.yan-tools-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Секции (левая и правая колонки) */
.yan-tools-input-section,
.yan-tools-result-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Заголовки секций */
.yan-tools-section-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yan-tools-section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.yan-tools-section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Кнопки в заголовке */
.yan-tools-file-btn,
.yan-tools-clear-btn,
.yan-tools-download-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.yan-tools-file-btn:hover,
.yan-tools-clear-btn:hover,
.yan-tools-download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.yan-tools-file-btn:active,
.yan-tools-clear-btn:active,
.yan-tools-download-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Кнопка переключения режимов */
.yan-tools-switch-mode-btn {
    background: rgba(155, 89, 182, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
    min-width: auto;
    justify-content: center;
}

.yan-tools-switch-mode-btn:hover {
    background: rgba(155, 89, 182, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

.yan-tools-switch-mode-btn:active {
    transform: translateY(0) scale(0.98);
}

.yan-tools-switch-icon {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.yan-tools-switch-mode-btn:hover .yan-tools-switch-icon {
    transform: rotate(180deg);
}

/* Textarea */
.yan-tools-input-textarea,
.yan-tools-result-textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #f8f9fa;
    color: #2c3e50;
    outline: none;
    flex: 1;
}

.yan-tools-input-textarea:focus,
.yan-tools-result-textarea:focus {
    background: #fff;
    box-shadow: inset 0 0 0 2px #27ae60;
}

.yan-tools-result-textarea {
    background: #f1f3f4;
    color: #495057;
}

/* Footer'ы с статистикой и кнопками */
.yan-tools-input-footer,
.yan-tools-result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    gap: 15px;
}

/* Статистика */
.yan-tools-input-stats,
.yan-tools-result-stats {
    font-size: 14px;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex: 1;
}

.yan-tools-input-stats.show,
.yan-tools-result-stats.show {
    opacity: 1;
}

.yan-tools-economy {
    color: #28a745;
    font-weight: 600;
    margin-left: 8px;
}

/* Кнопки сжатия и копирования */
.yan-tools-compress-btn,
.yan-tools-copy-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    width: 140px;
    height: 48px;
    justify-content: center;
}

.yan-tools-compress-btn:hover,
.yan-tools-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.6);
}

.yan-tools-compress-btn:active,
.yan-tools-copy-btn:active {
    transform: translateY(0) scale(0.98);
}

.yan-tools-compress-btn:disabled,
.yan-tools-copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Анимация загрузки */
.yan-tools-compress-btn.loading {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.yan-tools-compress-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.yan-tools-compress-btn.loading .yan-tools-compress-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Анимация копирования */
.yan-tools-copy-btn.copied {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.yan-tools-copy-btn.copied::before {
    content: "✓";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Статус копирования */
.yan-tools-copy-status {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yan-tools-copy-status.show {
    opacity: 1;
}

/* Настройки */
.yan-tools-settings-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.yan-tools-settings-header {
    background: linear-gradient(135deg, #16a085 0%, #138d75 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yan-tools-settings-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.yan-tools-settings-actions {
    display: flex;
    gap: 8px;
}

.yan-tools-select-all-btn,
.yan-tools-select-none-btn,
.yan-tools-reset-settings-btn,
.yan-tools-reset-decompress-settings-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yan-tools-select-all-btn:hover,
.yan-tools-select-none-btn:hover,
.yan-tools-reset-settings-btn:hover,
.yan-tools-reset-decompress-settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.yan-tools-settings-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.yan-tools-setting-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.yan-tools-setting-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.yan-tools-setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.yan-tools-setting-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #27ae60;
    cursor: pointer;
}

.yan-tools-checkbox-text {
    flex: 1;
    line-height: 1.4;
}

/* Стили для select элементов в настройках */
.yan-tools-setting-select {
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #495057;
    min-width: 120px;
}

.yan-tools-setting-select:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}

/* Стили для кнопки сброса настроек разжатия */
.yan-tools-reset-decompress-settings-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.yan-tools-reset-decompress-settings-btn:hover {
    background: #5a6268;
}

/* Стили для спойлера валидации */
.yan-tools-validation-toggle {
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 4px 0;
}

.yan-tools-validation-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.yan-tools-toggle-icon {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.yan-tools-validation-details {
    border-left: 3px solid;
    animation: slideDown 0.3s ease-out;
}

.yan-tools-validation-details[style*="rgba(220, 53, 69, 0.1)"] {
    border-left-color: #dc3545;
}

.yan-tools-validation-details[style*="rgba(255, 193, 7, 0.1)"] {
    border-left-color: #ffc107;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .yan-tools-php-compressor {
        padding: 15px;
    }
    
    .yan-tools-main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .yan-tools-section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .yan-tools-section-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .yan-tools-switch-mode-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .yan-tools-input-footer,
    .yan-tools-result-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .yan-tools-compress-btn,
    .yan-tools-copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .yan-tools-settings-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .yan-tools-settings-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .yan-tools-settings-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .yan-tools-header h2 {
        font-size: 24px;
    }
    
    .yan-tools-header p {
        font-size: 14px;
    }
    
    .yan-tools-input-textarea,
    .yan-tools-result-textarea {
        min-height: 200px;
        padding: 15px;
        font-size: 13px;
    }
    
    .yan-tools-section-header h3 {
        font-size: 16px;
    }
    
    .yan-tools-settings-header h3 {
        font-size: 16px;
    }
}
