/* Tool Hero Styles - Required */
.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);
    }
}

/* JSON to C# Converter Styles */
:root {
    --csharp-primary: #68217a;
    --csharp-primary-light: #8b3da8;
    --csharp-primary-dark: #4d1659;
    --csharp-accent: #0078d4;
    --csharp-accent-light: #40a6ff;
    --csharp-surface: #ffffff;
    --csharp-surface-alt: #f8f9fa;
    --csharp-surface-elevated: #ffffff;
    --csharp-border: #e1e4e8;
    --csharp-border-focus: #68217a;
    --csharp-text: #1e1e1e;
    --csharp-text-muted: #6e6e6e;
    --csharp-text-light: #8e8e8e;
    --csharp-success: #107c10;
    --csharp-success-light: #d4edda;
    --csharp-error: #d13438;
    --csharp-error-light: #f8d7da;
    --csharp-warning: #ffaa44;
    --csharp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --csharp-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --csharp-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --csharp-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --csharp-radius: 12px;
    --csharp-radius-sm: 8px;
    --csharp-radius-lg: 16px;
    --csharp-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.csharp-converter-section {
    margin-bottom: 3rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
}

@media (min-width: 992px) {
    .converter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    background: var(--csharp-surface-elevated);
    border: 1px solid var(--csharp-border);
    border-radius: var(--csharp-radius-lg);
    box-shadow: var(--csharp-shadow);
    overflow: hidden;
    transition: var(--csharp-transition);
}

.input-section:hover,
.output-section:hover {
    box-shadow: var(--csharp-shadow-md);
}

.section-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--csharp-primary) 0%, var(--csharp-primary-light) 100%);
    border-bottom: 1px solid var(--csharp-border);
}

.output-section .section-header {
    background: linear-gradient(135deg, var(--csharp-accent) 0%, var(--csharp-accent-light) 100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.title-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

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

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--csharp-radius-sm);
    color: #ffffff;
    cursor: pointer;
    transition: var(--csharp-transition);
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.options-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--csharp-surface-alt);
    border-bottom: 1px solid var(--csharp-border);
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--csharp-text-muted);
    white-space: nowrap;
}

.option-select,
.option-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    color: var(--csharp-text);
    background: var(--csharp-surface);
    border: 1px solid var(--csharp-border);
    border-radius: var(--csharp-radius-sm);
    transition: var(--csharp-transition);
    min-width: 120px;
}

.option-input {
    min-width: 140px;
}

.option-select:focus,
.option-input:focus {
    outline: none;
    border-color: var(--csharp-primary);
    box-shadow: 0 0 0 3px rgba(104, 33, 122, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--csharp-text);
    cursor: pointer;
    user-select: none;
    padding-top: 1.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--csharp-primary);
}

.editor-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px;
    position: relative;
}

.code-input {
    flex: 1;
    width: 100%;
    padding: 1.25rem;
    font-size: 14px;
    line-height: 1.6;
    color: var(--csharp-text);
    background: var(--csharp-surface);
    border: none;
    resize: none;
    outline: none;
    overflow-y: auto;
    tab-size: 4;
}

.code-input::placeholder {
    color: var(--csharp-text-light);
    opacity: 0.6;
}

.code-input:read-only {
    background: var(--csharp-surface-alt);
    cursor: default;
}

.editor-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--csharp-surface-alt);
    border-top: 1px solid var(--csharp-border);
    font-size: 0.8125rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--csharp-text-light);
    flex-shrink: 0;
}

.status-indicator.active {
    background: var(--csharp-success);
    box-shadow: 0 0 0 3px rgba(16, 124, 16, 0.2);
    animation: pulse 2s infinite;
}

.status-indicator.error {
    background: var(--csharp-error);
    box-shadow: 0 0 0 3px rgba(209, 52, 56, 0.2);
}

.status-indicator.processing {
    background: var(--csharp-warning);
    box-shadow: 0 0 0 3px rgba(255, 170, 68, 0.2);
    animation: pulse 1.5s infinite;
}

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

.status-text {
    color: var(--csharp-text-muted);
    font-weight: 500;
}

/* Mobile Optimizations */
@media (max-width: 991px) {
    .converter-grid {
        gap: 1.5rem;
    }

    .section-header {
        padding: 1rem 1.25rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .options-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem;
        gap: 0.875rem;
    }

    .option-item {
        width: 100%;
    }

    .option-select,
    .option-input {
        width: 100%;
        min-width: 0;
    }

    .checkbox-wrapper {
        padding-top: 0;
    }

    .editor-box {
        min-height: 350px;
    }

    .code-input {
        font-size: 13px;
        padding: 1rem;
    }
}

@media (max-width: 575px) {
    .csharp-converter-section {
        margin-bottom: 2rem;
    }

    .converter-grid {
        gap: 1.25rem;
    }

    .input-section,
    .output-section {
        border-radius: var(--csharp-radius);
    }

    .section-header {
        padding: 0.875rem 1rem;
    }

    .section-title {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .title-icon {
        width: 20px;
        height: 20px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }

    .icon-btn svg {
        width: 16px;
        height: 16px;
    }

    .options-bar {
        padding: 0.875rem 1rem;
    }

    .editor-box {
        min-height: 300px;
    }

    .code-input {
        font-size: 12px;
        padding: 0.875rem;
    }

    .editor-status {
        padding: 0.625rem 1rem;
        font-size: 0.75rem;
    }
}

/* Scrollbar Styling */
.code-input::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.code-input::-webkit-scrollbar-track {
    background: var(--csharp-surface-alt);
}

.code-input::-webkit-scrollbar-thumb {
    background: var(--csharp-border);
    border-radius: 5px;
}

.code-input::-webkit-scrollbar-thumb:hover {
    background: var(--csharp-text-muted);
}

/* Focus States */
.code-input:focus {
    background: var(--csharp-surface);
}

/* Selection Styling */
.code-input::selection {
    background: rgba(104, 33, 122, 0.2);
}

/* Copy Button Feedback */
.icon-btn.copied {
    background: var(--csharp-success);
    border-color: var(--csharp-success);
}

.icon-btn.copied svg {
    color: #ffffff;
}
