/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Main Tool Container */
.json-formatter-tool {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tool-container {
    width: 100%;
}

/* Header */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tool-header h1 i {
    color: #007bff;
}

.tool-description {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Converter Interface */
.converter-interface {
    margin-bottom: 30px;
}

.converter-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
}

/* Operation Mode Section */
.operation-mode {
    margin-bottom: 25px;
}

.operation-mode h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.mode-options {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-option {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-option:hover {
    background: #e9ecef;
}

.mode-option input[type="radio"] {
    margin-bottom: 8px;
    transform: scale(1.2);
}

.mode-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.mode-description {
    display: none;
}

/* Converter Content */
.converter-content {
    display: block;
}

.input-section,
.output-section {
    margin-bottom: 20px;
}

.section-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.json-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: #fff;
}

.json-textarea:focus {
    outline: none;
    border-color: #007bff;
}

.json-textarea[readonly] {
    background-color: #f8f9fa;
}

/* Statistics */
.input-stats,
.output-stats {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #6c757d;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-item i {
    color: #007bff;
}

/* Output Container */
.output-container {
    position: relative;
}

.btn-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    font-size: 0.85rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-copy:hover {
    background: #5a6268;
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Error Display */
.error-display {
    background: #f8d7da;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.error-content i {
    color: #721c24;
    font-size: 1.2rem;
    margin-top: 2px;
}

.error-details h4 {
    color: #721c24;
    margin-bottom: 5px;
    font-size: 1rem;
}

.error-details p {
    color: #721c24;
    margin-bottom: 8px;
}

.error-location {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #721c24;
    background: rgba(114, 28, 36, 0.1);
    padding: 8px;
    border-radius: 4px;
}

/* Sample Examples */
.sample-examples {
    margin-top: 25px;
}

.sample-examples h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sample-examples h3 i {
    color: #ffc107;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.example-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-item:hover {
    background: #e9ecef;
}

.example-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.example-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SEO Content Section */
.seo-content {
    background: white;
    margin-top: 30px;
    border-radius: 8px;
}

.content-container {
    padding: 30px;
}

.content-section {
    margin-bottom: 30px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.content-section h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 12px;
    margin-top: 20px;
}

.content-section h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    margin-top: 15px;
}

.content-section p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.content-section ul,
.content-section ol {
    color: #555;
    padding-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.content-section li strong {
    color: #2c3e50;
}

.content-section code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

/* Mobile Styles */
@media (max-width: 767px) {
    .json-formatter-tool {
        padding: 15px;
    }

    .operation-mode h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .mode-options {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px;
        justify-content: space-between;
        flex-wrap: nowrap !important;
    }

    .mode-option {
        min-width: 0;
        flex: 1;
        padding: 12px 8px;
        text-align: center;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .mode-label {
        font-size: 0.85rem;
        line-height: 1.2;
    }



    .mode-option input[type="radio"] {
        margin-bottom: 6px;
        transform: scale(1.1);
    }
}

/* Extra Small Mobile Styles */
@media (max-width: 360px) {
    .mode-options {
        gap: 6px;
    }

    .mode-option {
        padding: 10px 6px;
    }

    .mode-label {
        font-size: 0.8rem;
    }


}

/* Tablet Styles */
@media (min-width: 768px) {
    .json-formatter-tool {
        padding: 30px;
    }
    
    .tool-header h1 {
        font-size: 2.5rem;
    }
    
    .mode-options {
        gap: 20px;
    }
    
    .mode-option {
        flex: 1;
    }
    
    .controls {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .btn {
        min-width: 140px;
    }
    
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .converter-card {
        padding: 35px;
    }
    
    .converter-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
        align-items: start;
    }
    
    .input-section,
    .output-section {
        margin-bottom: 0;
    }
    
    .controls {
        grid-column: 1 / -1;
        justify-content: center;
        margin: 25px 0 0 0;
    }
    
    .content-container {
        padding: 40px;
    }
    
    .examples-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Success/Error States */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus Styles for Accessibility */
.btn:focus,
.json-textarea:focus,
.mode-option:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Related Tools Section */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.related-tools-header h3 i {
    color: #007bff;
}

.related-tools-header p {
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-tool-link {
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e9ecef;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.related-tool-link:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.related-tool-link i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Responsive Design for Related Tools */
@media (max-width: 768px) {
    .related-tools-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }

    .related-tool-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .related-tools-section {
        padding: 1rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }

    .related-tool-link {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        text-align: left;
    }
}
