:root {
    --primary-blue: #013d7a;
    --secondary-blue: #0066cc;
    --accent-pink: #ff3366;
    --light-bg: #f0f7ff;
    --card-bg: #ffffff;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e1e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --footer-bg: #0a192f;
    --footer-text: #ccd6f6;
    --footer-heading: #e6f1ff;
    --footer-border: #233554;
    --footer-hover: #64ffda;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --accent-green: #28a745;
    --tool-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4edf5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: white;
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    text-decoration: none;
    color: var(--footer-bg);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.logo a:hover {
    color: var(--accent-pink);
}

/* Navigation */
.nav-links {
    display: flex;
    margin-left: 30px;
}

.nav-item {
    position: relative;
    color: black;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.links a {
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
}

.links a:hover {
    color: var(--accent-pink);
}

.nav-item:hover {
    color: var(--accent-pink);
}

.dropdown-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Mega Dropdown Styles */
.mega-dropdown {
    position: absolute;
    top: 45px;
    left: -750px;
    background-color: white;
    width: 1200px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 30px;
    display: none;
    z-index: 1001;
    grid-template-columns: repeat(6, 1fr);
    border-top: 3px solid var(--accent-pink);
}

.nav-item:hover .mega-dropdown {
    display: grid;
    animation: fadeIn 0.3s ease;
}

.dropdown-section h3 {
    color: var(--primary-blue);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.dropdown-section h3 i {
    margin-right: 10px;
    color: var(--accent-pink);
    background: rgba(255, 51, 102, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background-color: #f0f7ff;
    color: var(--accent-pink);
}

.dropdown-link i {
    margin-right: 12px;
    color: var(--secondary-blue);
    width: 20px;
    text-align: center;
    font-size: 14px;
}

/* Mobile Toggle */
.mobile-toggle {
    margin-left: auto;
    display: none;
    background: none;
    border: none;
    color: var(--accent-pink);
    font-size: 24px;
    cursor: pointer;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: white;
    z-index: 999;
    transition: all 0.4s ease;
    overflow-y: auto;
    padding: 20px;
    box-shadow: var(--shadow);
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-category {
    margin-top: 20px;
}

.mobile-category-title {
    font-size: 18px;
    color: var(--primary-blue);
    font-weight: 500;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-pink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-category-title i {
    color: var(--accent-pink);
}

.mobile-tool-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
    background: #f8fafd;
    color: var(--text-dark);
}

.mobile-tool-link:hover {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    transform: translateX(5px);
    color: var(--accent-pink);
}

.mobile-tool-link i {
    margin-right: 15px;
    color: var(--secondary-blue);
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* JSON Formatter Styles */
.container {
    max-width: 1200px;
    margin: 40px auto 200px;
    padding: 0 20px;
    width: 100%;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    margin-bottom: 10px;
    color: var(--footer-bg);
    font-size: 2.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tool-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.tool-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 20px;
}

.tool-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: var(--primary-blue);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 auto;
    min-width: 120px;
    justify-content: center;
}

.action-buttons button:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-buttons button:active {
    transform: translateY(0);
}

.action-buttons button.secondary {
    background: white;
    color: var(--primary-blue);
    border: 1px solid var(--border-color);
}

.action-buttons button.secondary:hover {
    background: #f8fafd;
}

.action-buttons button.accent {
    background: var(--accent-pink);
}

.action-buttons button.accent:hover {
    background: #ff1a4d;
}

.tool-settings {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.setting-item label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.tool-content {
    display: flex;
    flex-wrap: wrap;
}

.input-section,
.output-section {
    flex: 1;
    min-width: 300px;
    padding: 25px;
}

.input-section {
    border-right: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h3 {
    color: var(--primary-blue);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.json-input {
    width: 100%;
    height: 400px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fcfdff;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    overflow: auto;
}

.json-output-container {
    position: relative;
    width: 100%;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafd;
    overflow: auto;
    padding: 15px;
}

.json-output {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre;
    color: #333;
}

.error-message {
    color: var(--error);
    background: #ffefed;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
    border-left: 4px solid var(--error);
}

.success-message {
    color: var(--success);
    background: #eaffea;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
    border-left: 4px solid var(--success);
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    padding: 15px 5px;
    background-color: #f0f4f9;
    border-right: 1px solid var(--border-color);
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #6c757d;
    overflow: hidden;
}

.line-number {
    padding: 0 10px;
    line-height: 1.5;
}

.json-output-content {
    padding-left: 40px;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #881391;
    font-weight: bold;
}

.json-string {
    color: #c41a16;
}

.json-number {
    color: #1c00cf;
}

.json-boolean {
    color: #0d22aa;
    font-weight: bold;
}

.json-null {
    color: #707070;
    font-weight: bold;
}

.json-punctuation {
    color: #000;
    font-weight: bold;
}

.counter-badge {
    background: var(--primary-blue);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.json-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    background: #f0f7ff;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.stat-label {
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.copyright {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.95rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .mega-dropdown {
        width: 1000px;
        left: -850px;
    }
}

@media (max-width: 1024px) {
    .mega-dropdown {
        width: 700px;
        grid-template-columns: repeat(3, 1fr);
        left: -600px;
    }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .mega-dropdown {
        width: 500px;
        grid-template-columns: repeat(2, 1fr);
        left: -450px;
    }
}

@media (max-width: 768px) {
    .header {
        height: 70px;
    }

    .logo a {
        font-size: 22px;
    }

    .mobile-sidebar {
        top: 70px;
        height: calc(100vh - 70px);
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-header p {
        font-size: 1rem;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .tool-actions {
        flex-direction: column;
        gap: 15px;
    }

    .action-buttons {
        justify-content: center;
    }

    .tool-settings {
        justify-content: center;
    }

    .json-input,
    .json-output-container {
        height: 300px;
    }
}

@media (max-width: 650px) {
    .tool-header h1 {
        font-size: 1.8rem;
    }

    .tool-header p {
        font-size: 0.95rem;
    }

    .action-buttons {
        gap: 8px;
        justify-content: center;
    }

    .action-buttons button {
        padding: 10px 12px;
        font-size: 0.9rem;
        flex: 1 1 40%;
        min-width: 100px;
    }

    .tool-settings {
        gap: 10px;
        justify-content: center;
    }

    .json-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .stat-item {
        min-width: 40%;
        text-align: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .char-count {
        align-self: flex-end;
        font-size: 0.9rem;
    }

    .input-section,
    .output-section {
        padding: 20px;
    }
}

@media (max-width: 550px) {
    .header {
        padding: 0 15px;
    }

    .logo a {
        font-size: 20px;
    }

    .tool-header h1 {
        font-size: 1.6rem;
    }

    .tool-header p {
        font-size: 0.9rem;
    }

    .json-input,
    .json-output-container {
        height: 250px;
    }

    .section-header h3 {
        font-size: 1.1rem;
    }

    .action-buttons button {
        padding: 8px 10px;
        font-size: 0.85rem;
        flex: 1 1 35%;
    }

    .setting-item {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .setting-item label {
        font-size: 0.85rem;
    }

    .json-stats {
        padding: 10px;
        gap: 12px;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .line-numbers {
        padding: 15px 3px;
        font-size: 12px;
    }

    .json-output-content {
        padding-left: 35px;
    }

    .error-message,
    .success-message {
        padding: 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {

    .input-section,
    .output-section {
        padding: 15px;
    }

    .action-buttons {
        gap: 6px;
    }

    .action-buttons button {
        flex: 1 1 45%;
        min-width: auto;
    }

    .tool-settings {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .json-stats {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .stat-item {
        min-width: 60%;
        align-items: center;
    }

    .mobile-sidebar {
        top: 60px;
        height: calc(100vh - 60px);
    }
}

@media (max-width: 360px) {
    .action-buttons button {
        flex: 1 1 100%;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .json-input,
    .json-output-container {
        height: 200px;
    }

    .section-header h3 {
        font-size: 1rem;
    }
}