/* Base64 Converter Styles */
.yan-tools-base64-converter {
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Скрываем мобильные карточки на десктопе */
.yan-tools-mobile-results {
    display: none;
}

.yan-tools-header {
    text-align: center;
    margin-bottom: 30px;
}

.yan-tools-header h2 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.yan-tools-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}


.yan-tools-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yan-tools-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.yan-tools-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.yan-tools-btn-secondary {
    background: #95a5a6;
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4);
}

.yan-tools-btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.6);
}

.yan-tools-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Upload Zone */
.yan-tools-upload-zone {
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.yan-tools-upload-zone.dragover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: scale(1.02);
}

.yan-tools-upload-content {
    max-width: 500px;
    margin: 0 auto;
}

.yan-tools-upload-icon {
    margin-bottom: 20px;
    color: #bdc3c7;
}

.yan-tools-upload-icon svg {
    width: 64px;
    height: 64px;
}

.yan-tools-upload-content h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.yan-tools-upload-content p {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Results Container */
.yan-tools-results {
    margin-top: 30px;
}

.yan-tools-results h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Кнопки управления результатами */
.yan-tools-results-controls {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* Прогресс-бар */
.yan-tools-progress-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.yan-tools-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.yan-tools-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.yan-tools-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.yan-tools-progress-details {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.yan-tools-results-table {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: white;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

#results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#results-table th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#results-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: top;
}

#results-table tbody tr:hover {
    background: #f8f9fa;
}

/* Preview Column */
.yan-tools-preview-cell {
    text-align: center;
    min-width: 150px;
}

.yan-tools-preview-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.yan-tools-file-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.yan-tools-file-info div {
    margin-bottom: 3px;
}

/* Code Columns */
.yan-tools-code-cell {
    position: relative;
    min-width: 300px;
}

.yan-tools-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.yan-tools-code-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.yan-tools-copy-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.yan-tools-copy-btn:hover {
    background: #229954;
    transform: translateY(-1px);
}

.yan-tools-copy-btn.copied {
    background: #3498db;
}

/* Кнопки переключения форматов */
.yan-tools-code-format-buttons {
    display: flex;
    gap: 5px;
    margin-right: 10px;
}

.yan-tools-format-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yan-tools-format-btn:hover {
    background: #5a6268;
}

.yan-tools-format-btn.active {
    background: #007cba;
}

.yan-tools-format-btn.active:hover {
    background: #005a87;
}

.yan-tools-code-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: vertical;
    background: #f8f9fa;
    color: #2c3e50;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.yan-tools-code-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.yan-tools-code-textarea:hover {
    border-color: #bdc3c7;
}

/* Info Panel */
.yan-tools-info-panel {
    margin-top: 50px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.yan-tools-info h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.yan-tools-info h4 {
    color: #34495e;
    font-size: 1.2rem;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.yan-tools-info p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.yan-tools-info ul {
    color: #7f8c8d;
    line-height: 1.6;
    margin-left: 20px;
}

.yan-tools-info li {
    margin-bottom: 8px;
}

/* Loading States */
.yan-tools-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .yan-tools-base64-converter {
        padding: 15px;
    }
    
    .yan-tools-header h2 {
        font-size: 2rem;
    }
    
    
    .yan-tools-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .yan-tools-upload-zone {
        padding: 30px 15px;
    }
    
    /* Мобильная версия - карточки вместо таблицы */
    .yan-tools-results-table {
        overflow-x: visible;
    }
    
    #results-table {
        display: none; /* Скрываем таблицу на мобильных */
    }
    
    /* Стили для мобильных карточек */
    .yan-tools-mobile-results {
        display: block;
    }
    
    .yan-tools-result-card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
        padding: 20px;
        border: 1px solid #ecf0f1;
    }
    
    .yan-tools-result-card:last-child {
        margin-bottom: 0;
    }
    
    .yan-tools-card-preview {
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid #ecf0f1;
    }
    
    .yan-tools-card-preview-image {
        max-width: 120px;
        max-height: 120px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        object-fit: cover;
        margin-bottom: 15px;
    }
    
    .yan-tools-card-file-info {
        font-size: 0.9rem;
        color: #7f8c8d;
        line-height: 1.4;
    }
    
    .yan-tools-card-file-info div {
        margin-bottom: 5px;
    }
    
    .yan-tools-card-code-section {
        margin-bottom: 20px;
    }
    
    .yan-tools-card-code-section:last-child {
        margin-bottom: 0;
    }
    
    .yan-tools-card-code-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .yan-tools-card-code-label {
        font-weight: 600;
        color: #2c3e50;
        font-size: 0.9rem;
    }
    
    .yan-tools-card-code-format-buttons {
        display: flex;
        gap: 5px;
    }
    
    .yan-tools-card-code-textarea {
        width: 100%;
        min-height: 80px;
        padding: 12px;
        border: 2px solid #ecf0f1;
        border-radius: 6px;
        font-family: 'Courier New', monospace;
        font-size: 0.8rem;
        line-height: 1.4;
        resize: vertical;
        background: #f8f9fa;
        color: #2c3e50;
        transition: border-color 0.3s ease;
    }
    
    .yan-tools-card-code-textarea:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .yan-tools-card-copy-btn {
        background: #27ae60;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 4px;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 500;
        margin-top: 10px;
        width: 100%;
    }
    
    .yan-tools-card-copy-btn:hover {
        background: #229954;
        transform: translateY(-1px);
    }
    
    .yan-tools-card-copy-btn.copied {
        background: #3498db;
    }
}

@media (max-width: 480px) {
    .yan-tools-header h2 {
        font-size: 1.8rem;
    }
    
    .yan-tools-upload-content h3 {
        font-size: 1.3rem;
    }
    
    .yan-tools-preview-image {
        max-width: 60px;
        max-height: 60px;
    }
    
    .yan-tools-code-textarea {
        min-height: 50px;
        font-size: 0.75rem;
    }
    
    .yan-tools-card-preview-image {
        max-width: 100px;
        max-height: 100px;
    }
    
    .yan-tools-card-code-textarea {
        min-height: 60px;
        font-size: 0.75rem;
    }
    
    .yan-tools-result-card {
        padding: 15px;
    }
}

/* Success/Error Messages */
.yan-tools-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.yan-tools-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.yan-tools-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* File Type Indicators */
.yan-tools-file-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 5px;
}

.yan-tools-file-type.jpg,
.yan-tools-file-type.jpeg {
    background: #e74c3c;
    color: white;
}

.yan-tools-file-type.png {
    background: #3498db;
    color: white;
}

.yan-tools-file-type.gif {
    background: #f39c12;
    color: white;
}

.yan-tools-file-type.webp {
    background: #9b59b6;
    color: white;
}

.yan-tools-file-type.svg {
    background: #1abc9c;
    color: white;
}

.yan-tools-file-type.bmp {
    background: #95a5a6;
    color: white;
}
