/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Excel Converter Styles */
.excel-converter-wrapper {
    margin-bottom: 2rem;
}

.converter-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Section Styles */
.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    background: var(--bs-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.input-section:hover,
.output-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #2d3748;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    border-radius: 6px;
}

.output-badge {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    background: var(--bs-white, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: #475569;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.action-btn.primary {
    color: var(--bs-white, #ffffff);
    background: #9c27b0;
    border-color: #9c27b0;
}

.action-btn.primary:hover {
    background: #7b1fa2;
    border-color: #7b1fa2;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn svg {
    flex-shrink: 0;
}

.btn-text {
    display: inline;
}

@media (max-width: 640px) {
    .btn-text {
        display: none;
    }
    
    .action-btn {
        padding: 0.5rem;
        min-width: 36px;
        justify-content: center;
    }
}

/* Editor Wrapper */
.editor-wrapper {
    position: relative;
    flex: 1;
    min-height: 400px;
    background: #1e1e1e;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Preview Wrapper */
.preview-wrapper {
    flex: 1;
    min-height: 400px;
    background: var(--bs-white, #ffffff);
    overflow: auto;
}

.preview-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #94a3b8;
    padding: 2rem;
    text-align: center;
}

.preview-placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    color: #64748b;
}

.placeholder-hint {
    font-size: 0.875rem;
    margin: 0;
    color: #94a3b8;
}

/* Excel Table Preview */
.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.excel-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.excel-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    background: #f8f9fa;
    white-space: nowrap;
}

.excel-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

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

.excel-table tbody tr:last-child td {
    border-bottom: none;
}

.preview-info {
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}

/* Section Footer */
.section-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-stats {
    display: flex;
    gap: 0.75rem;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    border-radius: 6px;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
}

.status-icon.success {
    background: #22c55e;
}

.status-icon.error {
    background: #ef4444;
}

.status-icon.processing {
    background: #f59e0b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Error Message */
.error-message {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
    margin: 1rem;
}

/* Converter Options */
.converter-options {
    background: var(--bs-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.options-header {
    margin-bottom: 1.5rem;
}

.options-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #2d3748;
}

.options-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.option-item {
    display: flex;
    flex-direction: column;
}

.option-label {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.label-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3748;
}

.label-hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

.option-input {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #2d3748;
    background: var(--bs-white, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.option-input:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

.options-toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.toggle-option:hover {
    background: #f8f9fa;
}

.toggle-option input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--bs-white, #ffffff);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-option input[type="checkbox"]:checked + .toggle-slider {
    background: #9c27b0;
}

.toggle-option input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.toggle-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3748;
}

.toggle-desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .converter-main {
        grid-template-columns: 1fr;
    }
    
    .editor-wrapper,
    .preview-wrapper {
        min-height: 350px;
    }
    
    .code-editor {
        min-height: 350px;
    }
    
    .preview-container {
        min-height: 350px;
    }
    
    .preview-placeholder {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .excel-converter-wrapper {
        margin-top: 1.5rem;
    }
    
    .converter-main {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .section-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .editor-wrapper,
    .preview-wrapper {
        min-height: 300px;
    }
    
    .code-editor {
        min-height: 300px;
    }
    
    .preview-container {
        min-height: 300px;
    }
    
    .preview-placeholder {
        min-height: 300px;
        padding: 1.5rem;
    }
    
    .section-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .converter-options {
        padding: 1.25rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1rem;
    }
    
    .section-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .action-btn {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.75rem;
    }
    
    .options-title {
        font-size: 1.125rem;
    }
    
    .excel-table {
        font-size: 0.8125rem;
    }
    
    .excel-table th,
    .excel-table td {
        padding: 0.5rem 0.75rem;
    }
}

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    .input-section,
    .output-section,
    .converter-options {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .section-header {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .section-title {
        color: #f1f5f9;
    }
    
    .action-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .action-btn:hover {
        background: #475569;
        color: #f1f5f9;
    }
    
    .preview-wrapper {
        background: #1e293b;
    }
    
    .excel-table thead {
        background: #0f172a;
    }
    
    .excel-table th {
        background: #0f172a;
        color: #f1f5f9;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .excel-table td {
        color: #cbd5e1;
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    
    .excel-table tbody tr:hover {
        background: #334155;
    }
    
    .section-footer {
        background: #0f172a;
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .option-input {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .toggle-option:hover {
        background: #334155;
    }
}
