/* Reset & Base */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* Re-open button (fixed, top-left, only visible when sidebar closed via JS) */
.reopen-sidebar {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #1e293b;
    color: #fff;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: none;           /* hidden by default, shown when sidebar closed */
}
.reopen-sidebar:hover {
    background: #2c3e50;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    padding: 20px 0;
    transform: translateX(0);
}
.sidebar.closed {
    transform: translateX(-100%);
}
.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 15px 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}
.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: #1e293b;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    margin-right: 10px;
    border-radius: 4px;
}
.sidebar-toggle-btn:hover {
    background: rgba(0,0,0,0.05);
}
.sidebar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav .sidebar-category { margin-bottom: 5px; }
.category-toggle {
    display: block;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    color: #2c3e50;
    transition: background 0.2s;
}
.category-toggle:hover { background: #f0f2f5; }
.tool-list { padding-left: 20px; display: none; }
.sidebar-category.active .tool-list { display: block; }
.tool-list li a {
    display: block;
    padding: 8px 20px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 4px;
    margin: 2px 10px;
    transition: background 0.2s;
}
.tool-list li a:hover { background: #eef1f5; color: #2c3e50; }

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}
.sidebar.closed ~ .main-content {
    margin-left: 0;
}

/* Top Bar – logo left, search/nav right, enough left padding to clear reopen button */
.top-bar {
    background: #fff;
    padding: 15px 30px 15px 60px;   /* left padding 60px clears the fixed reopen button */
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;  /* space between logo and right section */
}
.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.search-box { position: relative; }
.search-box input {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 200px;
    transition: width 0.3s;
}
.search-box input:focus { width: 250px; outline:none; border-color:#3498db; }
.search-results {
    position: absolute;
    top: 42px;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 300px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}
.search-results.active { display: block; }
.search-result-item { padding: 10px; border-bottom: 1px solid #eee; }
.search-result-item a { color: #2c3e50; text-decoration:none; font-weight:500; }
.search-result-item p { font-size:0.8rem; color:#777; margin-top:2px; }
nav a {
    margin-left: 15px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
}
nav a:hover { color: #3498db; }

/* Content Wrapper */
.content-wrapper { padding: 30px; flex: 1; }

/* Footer */
/* ====================================
   PROFESSIONAL FOOTER
   ==================================== */
.site-footer {
    background: #0f172a;                /* dark navy */
    color: #cbd5e1;
    padding: 40px 30px;
    margin-top: auto;
    text-align: center;
    font-size: 0.95rem;
}
.footer-container {
    max-width: 1000px;
    margin: 0 auto;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}
.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #ffffff;
}
.footer-social {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 18px;
}
.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.2s;
}
.footer-social a:hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-2px);
}
.footer-copy {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 10px;
}
/* Simple styling for static pages */
.static-page {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.static-page h1 {
    margin-bottom: 20px;
}
.static-page h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #1e293b;
}
.static-page p {
    line-height: 1.6;
    margin-bottom: 15px;
}
/* Home Page */
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 { font-size: 2.5rem; color: #2c3e50; }
.hero p { font-size: 1.2rem; color: #666; margin-top: 10px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.filter-btn {
    padding: 8px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: #3498db; color: #fff; border-color: #3498db; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.tool-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.tool-card:hover { transform: translateY(-5px); }
.tool-card a { text-decoration: none; color: inherit; display: block; }
.tool-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: #2c3e50; }
.tool-card p { color: #666; font-size: 0.9rem; }

/* Tool Page */
.tool-page h1 { font-size: 2rem; margin-bottom: 20px; }
.tool-description, .tool-interactive, .tool-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.tool-faq h2 { margin-bottom: 20px; }
.faq-item {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.faq-item h3 { margin-bottom: 8px; font-size: 1.1rem; }

/* Category Page */
.category-page h1 { font-size: 2rem; margin-bottom: 20px; }
.category-desc { color: #666; margin-bottom: 30px; }

/* Admin Panel Common */
.admin-container { max-width: 1200px; margin: 0 auto; }
.admin-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.admin-form label { font-weight: 600; margin-bottom: 5px; display: block; }
.admin-form input[type="text"], .admin-form input[type="email"],
.admin-form input[type="password"], .admin-form input[type="url"],
.admin-form select, .admin-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.error-message { color: #e74c3c; margin-bottom: 15px; }
.success-message { color: #27ae60; margin-bottom: 15px; }
.dashboard-stats { display: flex; gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-card h3 { font-size: 1rem; color: #777; }
.stat-card p { font-size: 2rem; font-weight: bold; color: #2c3e50; }
.table-container {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
table th { background: #f8f9fa; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .top-bar { justify-content: center; padding: 15px 20px; }
    .header-right { flex-wrap: wrap; justify-content: center; }
}