/* ================================================================
   JSON Utility Tools — Style Mandiri untuk JSON Formatter
   ================================================================ */

* {
    box-sizing: border-box;
}

body {
    background: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.custom-header {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    padding: 1.2rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.custom-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.custom-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.header-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header-menu-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    opacity: 0.85;
    transition: 0.2s;
    border-bottom: 2px solid transparent;
}

.header-menu-link:hover {
    opacity: 1;
    border-color: rgba(255,255,255,0.6);
}

/* Flex Layout Container */
.main-flex-container {
    flex: 1;
    display: flex;
    flex-direction: row;
}

@media (max-width: 768px) {
    .main-flex-container {
        flex-direction: column;
    }
}

/* Sidebar Menu Navigation */
.sidebar-menu {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .sidebar-menu {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 1rem;
    }
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: 0.2s all ease-in-out;
}

.menu-item-icon {
    display: inline-block;
    width: 1.25rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1;
}

.menu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.menu-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-info {
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-top: 1px dashed #e2e8f0;
    margin-top: 1rem;
}

/* Main Workspace Area */
.work-area {
    flex: 1;
    padding: 2rem;
}

@media (max-width: 576px) {
    .work-area {
        padding: 1rem;
    }
}

/* Tool Workspace Card */
.tool-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    padding: 2rem;
    margin-bottom: 2rem;
}

.tool-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2563eb;
    padding-left: 0.75rem;
}

.settings-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.indent-selector {
    padding: 0.35rem 1.5rem 0.35rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
}

/* Form Controls & Textareas */
.json-textarea, .output-area {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: 0.2s;
}

.json-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.output-area {
    background: #f8fafc !important;
    color: #0f172a;
}

/* Error Alert Box */
.error-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Utility Copy Button */
.btn-copy {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-copy:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-copy.copy-success {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

/* History Section */
.history-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.btn-clear-history {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-clear-history:hover {
    text-decoration: underline;
}

.history-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: 0.2s;
}

.history-item:hover {
    background: #f8fafc;
}

.history-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.history-tool {
    font-weight: 600;
    color: #475569;
}

.history-time {
    color: #94a3b8;
}

.history-preview {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SEO Content Section */
.seo-article-section h3 { font-size: 1.5rem; color: #1e293b; font-weight: 600; }
.seo-article-section h4 { font-size: 1.2rem; color: #334155; margin-top: 1.5rem; }
.seo-article-section h5 { font-size: 1rem; color: #475569; font-weight: 600; }
.seo-article-section p, .seo-article-section li { color: #64748b; font-size: 0.95rem; line-height: 1.6; }

/* Hidden Full Info Pages Content */
.info-content-full { display: none; }
.info-content-full.about-page  { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.info-content-full.learn-page  { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.info-content-full.contact-page { background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); }

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0d6efd;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: 0.3s;
    z-index: 1000;
    border: none;
}

.scroll-to-top.show { opacity: 1; }

/* Feedback Form Styles (image_c0dc5f.png Reference) */
.feedback-textarea, .feedback-input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
}
.feedback-textarea:focus, .feedback-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.feedback-form-container .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    font-weight: 500;
    padding: 0.6rem;
    border-radius: 6px;
}