:root {
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-light: #818cf8;
    /* Indigo 400 */
    --primary-dark: #3730a3;
    /* Indigo 800 */
    --accent: #06b6d4;
    /* Cyan 500 */
    --bg: #f8fafc;
    /* Slate 50 */
    --card-bg: #ffffff;
    --text: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    /* Light background */
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    backdrop-filter: blur(10px);
}

.search-box-container {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.search-box-container input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    color: var(--text);
    /* Dark text */
    font-size: 1.5rem;
    padding: 0.5rem 0;
    outline: none;
    box-shadow: none;
}

.search-box-container input:focus {
    box-shadow: none;
    border-color: var(--accent);
}

#close-search {
    background: none;
    border: none;
    color: var(--text-muted);
    /* Darker icon */
    font-size: 2rem;
    cursor: pointer;
    padding: 0 1rem;
    transition: color 0.2s;
}

#close-search:hover {
    color: var(--primary);
}

.search-results {
    max-width: 600px;
    width: 100%;
    margin: 2rem auto 0;
    overflow-y: auto;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    background: -webkit-linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    -webkit-text-fill-color: initial;
}

.search-trigger {
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.search-trigger:hover {
    background: #f1f5f9;
}

/* Main Layout */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    flex: 1;
    /* Pushes footer down */
}

/* List View Dashboard */
.hero-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0 1.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-list-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.list-search {
    position: relative;
    width: 250px;
}

.list-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 3.5rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.list-search input:focus {
    width: 300px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.list-search::before {
    content: '🔍';
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
    pointer-events: none;
}

/* List Groups */
.list-category-group {
    margin-bottom: 2.5rem;
}

.list-cat-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent);
}

.tools-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Masonry-like grid of lists */
    gap: 1rem;
}

.tool-list-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tool-list-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: #f8fafc;
}

.list-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-info {
    flex: 1;
}

.list-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.list-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s;
}

.tool-list-item:hover .list-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--primary);
}

.badge-new {
    background: #ec4899;
    color: white;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Tool View Specifics */
.tool-view {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.tool-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Forms & Inputs */
.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #334155;
}

input[type="number"],
input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    font-family: inherit;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.btn-calc {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
    margin-top: 1rem;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn-calc:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.4);
}

.btn-calc:active {
    transform: translateY(1px);
}

/* Results */
.result-card {
    margin-top: 2rem;
    border: none;
    border-left: 5px solid var(--primary);
    background: #fff;
}

.result-val {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
    letter-spacing: -0.05em;
}

/* Professional Footer */
.app-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 4rem 1.5rem 2rem;
    margin-top: auto;
    width: 100%;
    color: var(--text-muted);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 1rem;
    max-width: 250px;
}

.footer-bottom {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
}

.footer-bottom-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* Responsive */
@media (min-width: 640px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .hero-section h1 {
        font-size: 3rem;
    }
}

@media (max-width: 639px) {
    .hero-section {
        border-radius: 0 0 2rem 2rem;
        padding-bottom: 5rem;
    }

    .hero-search input {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}