/*
  =======================================================
  Futuristic Dark Mode Theme & UI for Multi Tool Hub
  =======================================================
*/

/* --- THEME & GLOBAL STYLES --- */
:root {
    --bg-color: #12121C;
    --text-color: #EAEAEA;
    --accent-cyan: #00FFFF;
    --accent-purple: #9c27b0;
    --card-bg: rgba(43, 45, 66, 0.4);
    --header-bg: rgba(18, 18, 28, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-bg: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-color); color: var(--text-color); font-family: var(--font-family); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.d-none { display: none !important; }

/* --- HEADER & NAVIGATION --- */
.main-header { background: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 1rem 0; position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--border-color); }
.navbar { display: flex; justify-content: space-between; align-items: center; }
.navbar-brand { font-size: 1.8rem; font-weight: 700; color: var(--text-color); text-decoration: none; text-shadow: 0 0 8px var(--accent-cyan); }
.main-nav { list-style: none; display: flex; align-items: center; gap: 2rem; margin: 0; padding: 0; }
.main-nav a { color: var(--text-color); text-decoration: none; font-weight: 500; padding: 0.5rem 0; position: relative; display: flex; align-items: center; gap: 0.25rem; }
.main-nav > li > a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--accent-cyan); transform: scaleX(0); transition: transform 0.3s ease; transform-origin: right; }
.main-nav > li > a:hover::after { transform: scaleX(1); transform-origin: left; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--header-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 0.5rem 0; list-style: none; min-width: 220px; z-index: 1001; margin-top: 0.5rem; }
.dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu a { padding: 0.75rem 1.5rem; white-space: nowrap; width: 100%; }
.dropdown-menu > li:hover > a { background: var(--accent-cyan); color: var(--bg-color); }
.dropdown-menu .dropdown > a::after { content: '›'; position: absolute; right: 1rem; font-size: 1.2em; transform: none !important; background: none; }
.dropdown-menu .dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu .dropdown .dropdown-menu { top: -0.5rem; left: 100%; }
.mobile-nav-toggle { display: none; background: none; border: none; color: var(--text-color); font-size: 2rem; cursor: pointer; z-index: 1002; }

/* --- HERO & WELCOME TEXT --- */
.hero-section { text-align: center; padding: 4rem 1rem; }
.hero-title { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; background: var(--gradient-bg); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.welcome-text { font-size: 1.2rem; color: rgba(234, 234, 234, 0.8); margin: -1rem auto 2rem auto; max-width: 700px; line-height: 1.7; }
.search-bar { max-width: 600px; margin: 0 auto; display: flex; border: 1px solid var(--border-color); border-radius: 50px; background: var(--card-bg); padding: 0.5rem; transition: border-color 0.3s, box-shadow 0.3s; }
.search-bar:focus-within { border-color: var(--accent-cyan); box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
.search-bar input { flex-grow: 1; background: transparent; border: none; color: var(--text-color); font-size: 1.1rem; padding: 0.5rem 1rem; }
.search-bar input:focus { outline: none; }
.search-bar button { background: var(--accent-cyan); color: var(--bg-color); border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.2s; }

/* --- ACCORDION & CARDS --- */
#category-accordion { display: flex; flex-direction: column; gap: 1.5rem; }
.category-group { background: var(--card-bg); backdrop-filter: blur(10px); border: 1px solid var(--border-color); border-radius: 12px; transition: border-color 0.4s ease; overflow: hidden; }
.category-group.active { border-color: var(--accent-cyan); }
.category-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; cursor: pointer; }
.category-title { font-size: 1.75rem; font-weight: 600; }
.category-count { font-size: 1rem; color: rgba(234, 234, 234, 0.6); margin-left: 1rem; }
.category-toggle-icon { font-size: 2rem; font-weight: 300; color: var(--accent-cyan); transition: transform 0.4s ease; }
.category-group.active .category-toggle-icon { transform: rotate(45deg); }
.tool-card-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding: 0 1.5rem; max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out, padding 0.5s ease-out; }
.category-group.active .tool-card-container { padding-bottom: 1.5rem; }
.tool-card { background-color: rgba(0,0,0,0.3); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s ease, background-color 0.3s ease; cursor: pointer; padding: 1.5rem; }
.tool-card:hover { transform: translateY(-5px); background-color: rgba(0, 255, 255, 0.05); }
.tool-card h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-color); }
.tool-card p { flex-grow: 1; color: rgba(234, 234, 234, 0.7); }

/* --- BLOG PAGE --- */
.blog-container { max-width: 800px; margin: 0 auto; }
.blog-post { background: var(--card-bg); padding: 2rem; border-radius: 12px; border: 1px solid var(--border-color); margin-bottom: 2rem; }
.blog-post h2 { color: var(--accent-cyan); margin-bottom: 1rem; }

/* --- MODAL & FOOTER --- */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); animation: fadeIn 0.3s ease; }
.modal-content { background: rgba(28, 28, 44, 0.8); backdrop-filter: blur(15px); margin: 5% auto; padding: 2.5rem; border: 1px solid var(--border-color); border-radius: 12px; width: 80%; max-width: 700px; position: relative; animation: slideIn 0.4s ease; }
.modal-close { color: var(--text-color); position: absolute; top: 1rem; right: 1.5rem; font-size: 2rem; font-weight: bold; cursor: pointer; transition: color 0.3s, transform 0.3s; }
.modal-close:hover { color: var(--accent-cyan); transform: rotate(90deg); }
.main-footer { text-align: center; padding: 2rem; margin-top: 3rem; background: #1a1a2e; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.2); border-left-color: var(--accent-cyan); border-radius: 50%; animation: spin 1s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- RESPONSIVE OVERRIDES --- */
@media (max-width: 992px) {
    .main-nav { display: none; flex-direction: column; position: fixed; top: 0; right: 0; width: 100%; max-width: 320px; height: 100vh; background: var(--bg-color); padding: 6rem 2rem 2rem 2rem; gap: 1rem; transform: translateX(100%); transition: transform 0.4s ease-in-out; }
    .main-nav.mobile-active { display: flex; transform: translateX(0); }
    .main-nav .dropdown { width: 100%; }
    .main-nav .dropdown .dropdown-menu { display: none; position: static; border: none; background: none; box-shadow: none; padding-left: 1rem; }
    .main-nav .dropdown:hover > .dropdown-menu { display: none; } /* Disable hover on mobile */
    .dropdown-menu .dropdown > a::after { display: none; }
    .mobile-nav-toggle { display: block; z-index: 1002; }
    .tool-card-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .tool-card-container { grid-template-columns: 1fr; }
    .hero-title, .hero-section h1 { font-size: 2.5rem; }
}

/* --- HIGHLIGHT: THE GLOBAL FIX FOR ALL FORM ELEMENTS --- */
.tool-container label {
    font-weight: bold;
    color: var(--accent-cyan);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

/* This rule now includes textarea, fixing the global issue */
.tool-container input[type="text"],
.tool-container input[type="number"],
.tool-container input[type="date"],
.tool-container input[type="color"],
.tool-container select,
.tool-container textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* This rule also needs textarea for the focus effect */
.tool-container input:focus,
.tool-container select:focus,
.tool-container textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.tool-container textarea {
    min-height: 150px; /* Give textareas a good default size */
    resize: vertical; /* Allow users to resize vertically */
}

/* Fix for buttons inside the modal */
.tool-container .tool-btn {
    background: var(--gradient-bg);
    color: var(--bg-color);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tool-container .tool-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.2), 0 6px 20px rgba(255, 77, 206, 0.2);
}