/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #343a40;
    --heading-color: #212529;
    --border-color: #dee2e6;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--heading-color); font-weight: 700; margin-bottom: 1rem; line-height: 1.3; }

/* --- Header & Navigation --- */
.header { background: var(--surface-color); padding: 15px 0; border-bottom: 1px solid var(--border-color); box-shadow: var(--box-shadow); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 28px; font-weight: 700; color: var(--heading-color); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--primary-color); }
.site-tagline { color: var(--secondary-color); font-size: 14px; }

.nav { background: var(--primary-color); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-menu { list-style: none; display: flex; }

.nav-menu a { display: block; color: white; text-decoration: none; padding: 14px 22px; transition: background 0.2s ease; font-weight: 500; }
.nav-menu a:hover, .nav-menu a.active { background: rgba(0, 0, 0, 0.1); }

/* --- Main Layout --- */
.main-container { display: grid; grid-template-columns: 1fr 320px; gap: 30px; margin-top: 30px; }
.main-content { background: var(--surface-color); padding: 30px; border-radius: 8px; box-shadow: var(--box-shadow); }
.tool-header { border-bottom: 2px solid var(--primary-color); padding-bottom: 15px; margin-bottom: 25px; }
.tool-header h1 { font-size: 2.2rem; }

/* --- Content Area Typography --- */
/*.info-section { margin-top: 40px; padding-top: 25px; border-top: 1px solid var(--border-color); }*/
/* HOMEPAGE FIX: Remove top border and padding on homepage info sections */
.page-home .info-section { border-top: none; padding-top: 0; margin-top: 20px; }
.info-section h2 { font-size: 1.8rem; margin-top: 1.5em; margin-bottom: 0.8em; }
.info-section h3 { font-size: 1.4rem; margin-top: 1.5em; margin-bottom: 0.5em; }
.info-section p { margin-bottom: 1.2em; }
.info-section ul, .info-section ol { padding-left: 25px; margin-bottom: 1.2em; }
.info-section li { margin-bottom: 0.5em; }
.info-section a { font-weight: 500; text-decoration: underline; text-decoration-color: rgba(0, 123, 255, 0.3); transition: text-decoration-color 0.2s; }
.info-section a:hover { text-decoration-color: var(--primary-color); }
.info-section strong { font-weight: 700; color: var(--heading-color); }
.info-section code { background-color: #e9ecef; padding: .2em .4em; margin: 0; font-size: 85%; border-radius: 3px; }

/* --- Sidebar --- */
.sidebar-widget { background: var(--surface-color); padding: 20px; border-radius: 8px; box-shadow: var(--box-shadow); margin-bottom: 30px; }
.sidebar-widget h3 { font-size: 1.2rem; padding-bottom: 10px; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.sidebar-widget ul { list-style: none; padding-left: 0; }
.sidebar-widget li { margin-bottom: 10px; }
.sidebar-widget a { font-weight: 500; transition: color 0.2s; }

/* --- Tool Interface Styles --- */
.options-panel { background: #f8f9fa; padding: 15px; margin-bottom: 20px; border: 1px solid var(--border-color); border-radius: 4px; }
.options-group { display: flex; gap: 30px; flex-wrap: wrap; }
.option { display: flex; align-items: center; gap: 8px; }
.controls { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.btn { padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: bold; transition: all 0.2s ease; color: white; }
.btn-format { background: #007bff; } .btn-format:hover { background: #0056b3; }
.btn-minify { background: #fd7e14; } .btn-minify:hover { background: #d36306; }
.btn-clear { background: #dc3545; } .btn-clear:hover { background: #b02a37; }
.btn-sample { background: #6f42c1; } .btn-sample:hover { background: #59369a; }
.btn-copy { background: #28a745; } .btn-copy:hover { background: #218838; }
.editor-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-panel { border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden; }
.editor-header { background: #f8f9fa; padding: 10px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; font-weight: 500; }
textarea { width: 100%; height: 400px; padding: 15px; border: none; font-family: 'Courier New', monospace; font-size: 14px; resize: vertical; }
textarea:focus { outline: 2px solid var(--primary-color); outline-offset: -2px; }
.alert { padding: 15px; border-radius: 4px; margin-bottom: 20px; display: none; }
.alert.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Footer --- */
.site-footer { background: #343a40; color: #adb5bd; margin-top: 50px; padding: 50px 0; font-size: 15px; }
.footer-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; margin-bottom: 40px; }
.footer-column h3 { color: #ffffff; font-size: 16px; margin-bottom: 15px; font-weight: 500; text-transform: uppercase; }
.footer-column ul { list-style: none; padding: 0; }
.footer-column li { margin-bottom: 10px; }
.footer-column a { color: #adb5bd; text-decoration: none; transition: color 0.2s; }
.footer-column a:hover { color: #ffffff; text-decoration: underline; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid #495057; }

/* --- RESPONSIVE MENU STYLES --- */
.menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}
.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}
.menu-toggle.active .bar:nth-child(1) { transform: rotate(45deg) translate(7px, 6px); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* --- Responsive Breakpoints --- */
@media (max-width: 992px) {
    .main-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .editor-container { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; gap: 10px; }
    
    .nav {
        position: relative; /* Needed for the absolute positioned dropdown */
        /* ADDED: Gives the mobile nav bar vertical breathing room */
        padding: 10px 0;
    }
    
    .menu-toggle { display: flex; } /* Show hamburger on mobile */
    .nav-menu {
        display: none; /* Hide menu by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .nav-menu.active { display: flex; } /* Show menu when active */
    .nav-menu a { width: 100%; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .nav-menu a:last-child { border-bottom: none; }
}