/* JSON Formatter specific styles */

.json-formatter {
    max-width: 1200px;
    margin: 0 auto;
}

.input-section, .output-section {
    margin-bottom: 2rem;
}

.input-section h3, .output-section h3 {
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

#jsonInput, #jsonOutput {
    width: 100%;
    height: 250px;
    background-color: #1a202c;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

#jsonInput:focus, #jsonOutput:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
}

#jsonInput::placeholder {
    color: #a0aec0;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    outline: none;
}

.btn-primary {
    background-color: #3182ce;
    color: white;
}

.btn-primary:hover {
    background-color: #2c5aa0;
}

.btn-primary.active {
    background-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.3);
}

.btn-secondary {
    background-color: #4a5568;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background-color: #2d3748;
}

.btn-secondary.active {
    background-color: #2d3748;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.3);
}

.btn-copy {
    background-color: #38a169;
    color: white;
    font-size: 12px;
    padding: 0.375rem 0.75rem;
}

.btn-copy:hover {
    background-color: #2f855a;
}

.btn-copy:disabled {
    background-color: #68d391;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-copy.copied {
    background-color: #2f855a;
    transform: scale(0.95);
}

.indent-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.indent-control label {
    color: #a0aec0;
    font-size: 14px;
}

#indentSize {
    background-color: #2d3748;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 14px;
    outline: none;
}

#indentSize:focus {
    border-color: #63b3ed;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.status {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.status.success {
    background-color: rgba(56, 161, 105, 0.2);
    color: #68d391;
    border: 1px solid rgba(56, 161, 105, 0.3);
    display: block;
}

.status.error {
    background-color: rgba(245, 101, 101, 0.2);
    color: #fc8181;
    border: 1px solid rgba(245, 101, 101, 0.3);
    display: block;
}

.status.info {
    background-color: rgba(49, 130, 206, 0.2);
    color: #63b3ed;
    border: 1px solid rgba(49, 130, 206, 0.3);
    display: block;
}

/* Grid layout for side-by-side view */
@media (min-width: 769px) {
    .json-formatter {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
    }
    
    .input-section, .output-section {
        margin-bottom: 0;
    }
}

/* Loading animation */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .indent-control {
        justify-content: center;
    }
    
    .output-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    #jsonInput, #jsonOutput {
        height: 200px;
    }
}