/* 
 * SEO Tools Suite - Premium Design System
 * Theme: Indigo/Slate
 */

:root {
    /* Brand Colors */
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary: #0f172a; /* Slate 900 */
    --accent: #06b6d4; /* Cyan 500 */
    
    /* Backgrounds */
    --bg-body: #f8fafc; /* Slate 50 */
    --bg-card: #ffffff;
    --bg-input: #f1f5f9; /* Slate 100 */
    
    /* Text */
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --text-light: #f8fafc;
    
    /* Borders & Shadows */
    --border: #e2e8f0; /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --container-max: 1200px;
    --header-height: 70px;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { color: var(--secondary); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h1 { font-size: 2.25rem; letter-spacing: -0.025em; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo span { color: var(--secondary); }

/* Navigation */
.nav-menu { display: flex; gap: 2rem; align-items: center; }
.nav-item { position: relative; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.nav-item:hover { color: var(--secondary); }
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: -1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    width: 250px;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1.5rem; /* Gap filler */
}
.nav-item:hover .nav-dropdown { display: flex; }
.dropdown-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--text-main);
}
.dropdown-link:hover { background: var(--bg-input); color: var(--primary); }

.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Main Content */
main { flex: 1; padding: 3rem 0; }

/* Tool Layout */
.tool-header { text-align: center; margin-bottom: 3rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.tool-badges { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.badge {
    background: #e0e7ff;
    color: var(--primary);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
}

.tool-interface {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 3rem;
}

/* Forms & Inputs */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--secondary); }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-input);
    font-size: 1rem;
    transition: all 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
textarea.form-control { min-height: 120px; font-family: monospace; }
select.form-control { cursor: pointer; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-secondary:hover { background: var(--bg-input); }
.btn-block { width: 100%; }

/* Results Area */
.results-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: none; /* Hidden by default */
}
.results-area.active { display: block; animation: fadeIn 0.3s ease; }
.result-card {
    background: var(--bg-input);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.metric-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    text-align: center;
}
.metric-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.metric-label { color: var(--text-muted); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 0.5rem; overflow: hidden; }
th { background: var(--bg-input); font-weight: 600; text-align: left; padding: 1rem; font-size: 0.875rem; }
td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }

/* States */
.loader {
    border: 3px solid var(--bg-input);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Footer */
footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 3rem 0; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; margin-bottom: 3rem; }
.footer-links h4 { font-size: 1rem; margin-bottom: 1rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .nav-menu { display: none; position: absolute; top: var(--header-height); left: 0; right: 0; flex-direction: column; background: var(--bg-card); padding: 1rem; border-bottom: 1px solid var(--border); gap: 0; }
    .nav-menu.active { display: flex; }
    .nav-item { width: 100%; padding: 1rem 0; border-bottom: 1px solid var(--border); }
    .nav-dropdown { position: static; width: 100%; box-shadow: none; border: none; padding: 0 0 0 1rem; display: none; }
    .nav-item.active .nav-dropdown { display: flex; }
    .mobile-toggle { display: block; }
    .tool-interface { padding: 1.5rem; }
}
