/* hackatools.net - Main Stylesheet */

/* === Variables === */
:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* === Header === */
.header {
    background: #fff;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand .logo i {
    font-size: 1.75rem;
}

.navbar-toggler {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
}

.navbar-toggler span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: var(--transition);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.navbar-nav a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.navbar-nav a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* === Search Box === */
.search-box {
    position: relative;
}

.search-box input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 250px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* === Language Switcher === */
.language-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--primary-color);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    display: none;
    z-index: 100;
}

.lang-dropdown.active {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.lang-option:hover {
    background: var(--light-color);
}

.lang-option.active {
    background: var(--primary-color);
    color: #fff;
}

/* === Main Content === */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* === Hero Section === */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* === Categories Grid === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.category-card .tool-count {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--light-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* === Tools Grid === */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.tool-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.tool-card .btn {
    width: 100%;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

/* === Tool Page === */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.tool-container {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.tool-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-box {
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.copy-btn:hover {
    background: var(--secondary-color);
}

/* === AdSense === */
.ad-container {
    margin: 2rem 0;
    text-align: center;
}

.ad-sidebar {
    position: sticky;
    top: 100px;
}

/* === Footer === */
.footer {
    background: var(--dark-color);
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
    color: #fff;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: #fff;
    padding-left: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .navbar-toggler {
        display: flex;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    .navbar-actions {
        flex-direction: column;
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .tool-actions {
        flex-direction: column;
    }

    .tool-actions .btn {
        width: 100%;
    }
}

.category-card .category-icon {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white !important;
}


/* === Search Results Dropdown === */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-loading,
.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-loading i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.search-no-results i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: block;
}

.search-no-results p {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.search-no-results small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.search-results-list {
    padding: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background: var(--light-color);
    transform: translateX(4px);
}

.search-result-item.search-hint {
    cursor: default;
    border: 2px dashed var(--border-color);
    background: var(--light-color);
}

.search-result-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.search-hint .search-result-icon {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.search-result-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-view-all {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.search-view-all a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.search-view-all a:hover {
    background: var(--light-color);
    gap: 0.75rem;
}

/* === Utilities === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
