/* AI JSON Formatter Styles */

.ai-json-formatter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}


.drag-over {
    border: 2px dashed #667eea !important;
    background-color: #f0f4ff !important;
}


/* Header Styles */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.tool-header h2 {
    margin: 0 0 15px 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tool-header p {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feature-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.ai-badge {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    animation: aiGlow 3s ease-in-out infinite alternate;
    border: none;
}

@keyframes aiGlow {
    from { 
        box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
        transform: scale(1);
    }
    to { 
        box-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
        transform: scale(1.05);
    }
}

/* AI Section Styles */
.ai-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.ai-generator h3 {
    margin: 0 0 20px 0;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .ai-input-group {
        flex-direction: column;
    }
}

#ai-prompt {
    flex: 1;
    min-height: 100px;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#ai-prompt:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

#ai-prompt::placeholder {
    color: rgba(255,255,255,0.7);
}

.btn-ai {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 180px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-ai:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.btn-ai:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ai-examples {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.example-chip {
    background: rgba(255,255,255,0.2);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.example-chip:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Main Tool Layout */
.json-tool-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .json-tool-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.input-section, .output-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.input-section:hover, .output-section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.char-counter, .format-stats {
    font-size: 0.9em;
    color: #666;
    display: flex;
    gap: 15px;
}

#json-input {
    width: 100%;
    height: 300px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

#json-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tool-buttons {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-clear {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-clear {
    background: #dc3545;
    color: white;
}

.btn-clear:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.shortcuts-hint {
    margin-top: 15px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

kbd {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-family: monospace;
    font-size: 0.85em;
    padding: 2px 6px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Output Section */
.output-area {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.output-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

#formatted-json {
    padding: 15px;
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
    background: transparent;
    min-height: 270px;
    overflow-x: auto;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #d73a49;
    font-weight: 600;
}

.json-string {
    color: #032f62;
}

.json-number {
    color: #0969da;
}

.json-boolean {
    color: #0969da;
    font-weight: 600;
}

.json-null {
    color: #6f42c1;
    font-style: italic;
}

.json-bracket {
    color: #24292e;
    font-weight: 600;
}

.output-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-copy, .btn-download, .btn-share {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-download {
    background: #17a2b8;
}

.btn-download:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-share {
    background: #6f42c1;
}

.btn-share:hover {
    background: #5a32a3;
    transform: translateY(-2px);
}

/* Status Messages */
.status {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    white-space: pre-line;
    max-height: 200px;
    overflow-y: auto;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading Animation */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
    background: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AI Animation Effects */
.ai-generated {
    border-color: #4ecdc4 !important;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.4) !important;
    animation: aiGeneratedPulse 2s ease-in-out;
}

.ai-fixed {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.4) !important;
    animation: aiFixedPulse 2s ease-in-out;
}

@keyframes aiGeneratedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes aiFixedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Content Section */
.tool-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 30px;
}

.content-section h3 {
    color: #333;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.content-section h3:first-child {
    margin-top: 0;
}

.content-section p, .content-section li {
    color: #666;
    line-height: 1.7;
    margin-bottom: 12px;
}

.content-section ul, .content-section ol {
    padding-left: 25px;
    margin-bottom: 20px;
}

.content-section ul li {
    margin-bottom: 10px;
}

.content-section strong {
    color: #333;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.comparison-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.comparison-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.comparison-item h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.comparison-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* Prompt Analysis */
.prompt-analysis {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.prompt-analysis h4 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 1.1em;
}

.prompt-analysis p {
    margin: 8px 0;
    color: rgba(255,255,255,0.9);
    font-size: 0.9em;
}

.prompt-analysis ul {
    margin: 10px 0;
    padding-left: 20px;
}

.prompt-analysis li {
    color: rgba(255,255,255,0.9);
    font-size: 0.9em;
    margin-bottom: 5px;
}



/* Responsive Design */
@media (max-width: 768px) {
    .ai-json-formatter-container {
        padding: 15px;
    }
    
    .tool-header {
        padding: 20px 15px;
    }
    
    .ai-section {
        padding: 20px;
    }
    
    .input-section, .output-section {
        padding: 20px;
    }
    
    .tool-content {
        padding: 25px 20px;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tool-buttons, .output-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary, .btn-clear, .btn-ai, .btn-copy, .btn-download, .btn-share {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .feature-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .tool-header,
    .ai-section,
    .quick-actions,
    .tool-buttons,
    .output-actions,
    .shortcuts-hint {
        display: none;
    }
    
    .json-tool-wrapper {
        grid-template-columns: 1fr;
    }
    
    .output-section {
        page-break-inside: avoid;
    }
}

.json-formatter-loading {
    opacity: 0.6;
    pointer-events: none;
}

.json-formatter-success {
    border-left: 4px solid #10b981;
    background-color: #ecfdf5;
    padding: 10px;
    margin: 10px 0;
}

.json-formatter-error {
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
    padding: 10px;
    margin: 10px 0;
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    /* JSON Tool Mobile */
    #json-input,
    #formatted-json {
        font-size: 14px;
        min-height: 200px;
    }
    
    .tool-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .tool-buttons button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tool-buttons {
        grid-template-columns: 1fr;
    }
    
    .hero-section {
        padding: 40px 0;
    }
}