/* Pretify JSON Styles - Reference: imagetobinary.css */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0a58ca;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}
.pretify-json-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    animation: float 3s ease-in-out infinite;
}
.icon-wrapper i {
    font-size: 2.5rem;
    color: white;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.header-text {
    text-align: left;
}
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}
.page-description {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}
.converter-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 3rem;
}
.upload-section {
    margin-bottom: 2rem;
}
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--light-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.upload-content {
}
.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}
.file-input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f8f9fa;
    resize: vertical;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.file-info {
    margin-top: 1rem;
}
.action-section {
    text-align: center;
    margin: 2rem 0;
}
.btn-convert {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
}
.btn-convert:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-convert i {
    font-size: 1.3rem;
}
.loading-section {
    text-align: center;
    padding: 3rem 0;
}
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(13, 110, 253, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-spinner p {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}
.results-section {
    margin-top: 2rem;
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.result-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}
.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tab-btn:hover {
    color: var(--primary-color);
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.result-content {
    position: relative;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.output-header h4 {
    margin: 0;
    font-weight: 600;
}
.btn-copy {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.btn-copy:hover {
    background: #157347;
    transform: scale(1.05);
}
.btn-copy.copied {
    background: var(--warning-color);
    animation: pulse 0.5s ease-out;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.output-box {
    background: #282c34;
    border-radius: 8px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}
.code-output {
    color: #abb2bf;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}
.download-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.btn-download {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-download:hover {
    background: #157347;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease-out;
}
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}
.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}
.alert-close:hover {
    opacity: 1;
}
.info-section {
    margin-top: 4rem;
}
.info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}
.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.info-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(10, 88, 202, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.info-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}
.info-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}
.info-card p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    .header-content {
        flex-direction: column;
    }
    .header-text {
        text-align: center;
    }
    .converter-card {
        padding: 1.5rem;
    }
    .upload-area {
        padding: 2rem 1rem;
    }
    .upload-icon {
        font-size: 3rem;
    }
    .result-tabs {
        flex-direction: column;
    }
    .tab-btn {
        width: 100%;
        justify-content: center;
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        margin-left: -2px;
    }
    .tab-btn.active {
        border-bottom-color: transparent;
        border-left-color: var(--primary-color);
    }
    .output-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .alert-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
.output-box::-webkit-scrollbar {
    width: 8px;
}
.output-box::-webkit-scrollbar-track {
    background: #1e2127;
    border-radius: 4px;
}
.output-box::-webkit-scrollbar-thumb {
    background: #4b5263;
    border-radius: 4px;
}
.output-box::-webkit-scrollbar-thumb:hover {
    background: #5c6370;
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
@media print {
    .upload-section,
    .action-section,
    .download-section,
    .info-section,
    .btn-copy {
        display: none;
    }
    .converter-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
