/* assets/css/style.css */

:root {
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary-color: #10b981;
    /* Emerald 500 */
    --bg-color: #f9fafb;
    /* Gray 50 */
    --card-bg: #ffffff;
    --text-main: #111827;
    /* Gray 900 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --border-color: #e5e7eb;
    /* Gray 200 */
    --nav-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin-bottom: 0.5em;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.text-center {
    text-align: center;
}

/* Utilities */
.container {
    width: 100%;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.section-margin {
    margin: 4rem 0;
}

/* Header */
header {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin-right: 1rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-grow: 1;
}

/* Tool Page Specifics */
.tool-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.tool-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: monospace;
    font-size: 1rem;
    margin-bottom: 1rem;
    resize: vertical;
}

.tool-input:focus {
    outline: 2px solid var(--primary-color);
    border-color: transparent;
}

.tool-results {
    margin-top: 2rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 1.5rem;
    border-radius: 0.5rem;
    display: none;
    /* Hidden by default */
}

/* Sidebar Layout */
.layout-container {
    display: flex;
    width: 100%;
    max-width: 100%;
    /* Full Width like YouTube */
}

.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 73px;
    /* Header height */
    height: calc(100vh - 73px);
    overflow-y: auto;
    flex-shrink: 0;
    display: none;
    /* Mobile */
    padding-bottom: 2rem;
}

@media (min-width: 1024px) {
    .sidebar {
        display: block;
    }
}



.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: #f3f4f6;
    color: var(--primary-color);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.sidebar-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 1rem 0 0.5rem 1rem;
}

.main-content {
    flex-grow: 1;
    padding: 0 1rem;
    min-width: 0;
}

/* Footer */
footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0;
    margin-top: auto;
    z-index: 50;
    /* Above layout */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-col h4 {
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #9ca3af;
}

.footer-col ul li a:hover {
    color: white;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* AI Tools Page Specific Styles */

/* Layout & Hero */


.ai-hero {
    padding: 2rem 1rem 4rem 1rem;
    background: linear-gradient(to bottom, #f0f9ff, #ffffff);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    border-radius: 0 0 2rem 2rem;
}

.ai-hero h1 {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.ai-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Search */
.ai-search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 99px;
    background: white;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
}

.ai-search-input {
    flex-grow: 1;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
    border-radius: 99px;
}

.ai-search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-search-btn:hover {
    background: var(--primary-hover);
}

/* Main Layout */
.ai-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    padding-bottom: 4rem;
}

/* Sidebar */
.ai-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.ai-sidebar-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-color);
}

.ai-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-category-list li {
    margin-bottom: 0.5rem;
}

.ai-category-list a {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.ai-category-list a:hover,
.ai-category-list a.active {
    background: #f3f4f6;
    color: var(--primary-color);
    font-weight: 600;
}

/* Content Area */
.ai-content {
    flex-grow: 1;
    min-width: 0;
}

.ai-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.ai-sort select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

/* AI Grid */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* AI Card */
.ai-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.ai-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.ai-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ai-card-icon {
    font-size: 2.5rem;
}

.ai-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    letter-spacing: 0.05em;
}

.ai-badge.free {
    background: #d1fae5;
    color: #065f46;
}

.ai-badge.paid {
    background: #fee2e2;
    color: #991b1b;
}

.ai-badge.freemium {
    background: #fef3c7;
    color: #92400e;
}

.ai-card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ai-card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.ai-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--bg-color);
    padding-top: 1rem;
    margin-top: auto;
}

.ai-category-tag {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 0.2rem 0.6rem;
    border-radius: 0.3rem;
}

.ai-visit-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.ai-visit-btn:hover {
    text-decoration: underline;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .ai-layout {
        flex-direction: column;
    }

    .ai-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
    }

    .ai-category-list {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .ai-category-list li {
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .ai-category-list a {
        white-space: nowrap;
        background: var(--bg-color);
    }
}

@media (max-width: 640px) {
    .ai-grid {
        grid-template-columns: 1fr;
    }

    .ai-hero h1 {
        font-size: 1.8rem;
    }
}

/* Base Container for portability */
.ai-page-container {
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top 10 Lists Design */
.ai-top10-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .ai-top10-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-top10-grid {
        grid-template-columns: 1fr;
    }
}

.ai-top10-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-top10-header {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.ai-top10-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.ai-top10-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    gap: 0.75rem;
    font-size: 0.95rem;
    transition: background 0.1s;
}

.ai-top10-item:last-child {
    border-bottom: none;
}

.ai-top10-item:hover {
    background: #f9fafb;
}

.ai-rank {
    font-weight: 600;
    color: var(--text-muted);
    width: 20px;
    font-size: 0.9rem;
}

.ai-rank-1 {
    color: #d97706;
}

.ai-rank-2 {
    color: #9ca3af;
}

.ai-rank-3 {
    color: #b45309;
}

.ai-tool-mini-icon {
    font-size: 1.2rem;
}

.ai-tool-name {
    flex-grow: 1;
    font-weight: 500;
    color: var(--text-main);
}

.ai-tool-link {
    color: var(--primary-color);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.ai-top10-item:hover .ai-tool-link {
    opacity: 1;
}

.ai-view-all {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.ai-view-all:hover {
    background: #f1f5f9;
}