/* CSV Encoding Converter Specific Styles */

.converter-tool-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border-light);
}

/* Tool Steps */
.tool-step {
    margin-bottom: 2rem;
}

.tool-step:last-of-type {
    margin-bottom: 0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.step-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-light);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-green);
    background: rgba(1, 155, 95, 0.05);
}

.upload-zone.drag-over {
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-green);
    opacity: 0.8;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.upload-btn:hover {
    background: var(--primary-dark);
}

.upload-btn .material-symbols-outlined {
    font-size: 20px;
}

/* Detection Results */
.detection-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.file-icon {
    width: 48px;
    height: 48px;
    background: rgba(1, 155, 95, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
}

.file-icon .material-symbols-outlined {
    font-size: 28px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    word-break: break-all;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.remove-file:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Encoding Info */
.encoding-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.encoding-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    min-width: 160px;
}

.encoding-card.detected {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.encoding-card.target {
    border-color: var(--primary-green);
    background: rgba(1, 155, 95, 0.05);
}

.encoding-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.encoding-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.encoding-card.target .encoding-value {
    color: var(--primary-green);
}

/* Encoding Selector */
.encoding-selector {
    margin-top: 1rem;
    width: 100%;
}

.encoding-selector label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.encoding-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.encoding-select:focus {
    border-color: var(--primary-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 155, 95, 0.1);
}

.encoding-select:hover {
    border-color: var(--primary-green);
}

.encoding-select optgroup {
    font-weight: 600;
    color: var(--text-dark);
}

.encoding-select option {
    padding: 0.5rem;
}

.encoding-card.target .encoding-select.output-select {
    font-weight: 600;
    font-size: 1rem;
    background-color: rgba(1, 155, 95, 0.05);
    border-color: var(--primary-green);
}

.confidence-badge {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-weight: 500;
}

.confidence-badge.high {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.confidence-badge.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.confidence-badge.low {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.encoding-arrow {
    color: var(--text-muted);
}

.encoding-arrow .material-symbols-outlined {
    font-size: 32px;
}

/* Preview Section */
.preview-section {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.preview-header .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary-green);
}

.preview-encoding-label {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-green);
    background: rgba(1, 155, 95, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
}

.preview-content {
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8f9fa;
    color: var(--text-dark);
}

.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Download Section */
.download-section {
    text-align: center;
    padding: 1rem 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 155, 95, 0.3);
}

.download-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-btn .material-symbols-outlined {
    font-size: 24px;
}

.download-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Status Message */
.status-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.status-message.info {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.3);
    color: #117a8b;
}

.status-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.status-message.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #856404;
}

.status-message.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.status-icon {
    font-size: 24px;
}

.status-text {
    font-size: 0.95rem;
}

/* Supported Encodings Grid */
.encodings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.encoding-group {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.encoding-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-green);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.encoding-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.encoding-group li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.encoding-group li::before {
    content: '✓';
    color: var(--primary-green);
    font-weight: bold;
}

/* How It Works Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.how-step {
    text-align: center;
    padding: 2rem;
}

.how-step-icon {
    width: 80px;
    height: 80px;
    background: rgba(1, 155, 95, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.how-step-icon .material-symbols-outlined {
    font-size: 40px;
    color: var(--primary-green);
}

.how-step h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-dark);
}

.how-step p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .converter-tool-container {
        padding: 1.5rem;
    }

    .upload-zone {
        padding: 2rem 1.5rem;
    }

    .encoding-info {
        flex-direction: column;
        gap: 1rem;
    }

    .encoding-arrow {
        transform: rotate(90deg);
    }

    .encoding-card {
        width: 100%;
        min-width: auto;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .file-info {
        flex-wrap: wrap;
    }

    .file-details {
        min-width: 0;
    }
}

/* Already UTF-8 state */
.already-utf8 {
    text-align: center;
    padding: 1.5rem;
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 10px;
}

.already-utf8 .material-symbols-outlined {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.already-utf8 p {
    margin: 0;
    color: #28a745;
    font-weight: 500;
}


