/* ========================================
   ToolHub Pro - Main Stylesheet
   ======================================== */

:root {
    --th-primary: #6366f1;
    --th-primary-dark: #4f46e5;
    --th-secondary: #8b5cf6;
    --th-accent: #06b6d4;
    --th-dark: #0f172a;
    --th-darker: #020617;
    --th-light: #f8fafc;
    --th-gray: #64748b;
    --th-success: #22c55e;
    --th-warning: #f59e0b;
    --th-danger: #ef4444;
    --th-card-bg: #1e293b;
    --th-border: #334155;
    --th-container: 1400px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--th-darker);
    color: var(--th-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
.th-container {
    max-width: var(--th-container);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.th-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--th-border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.th-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.th-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--th-light);
    text-decoration: none;
}

.th-logo i {
    background: linear-gradient(135deg, var(--th-primary), var(--th-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.75rem;
}

.th-nav .th-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.th-nav .th-menu a {
    color: var(--th-gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.th-nav .th-menu a:hover {
    color: var(--th-primary);
}

.th-header-btns {
    display: flex;
    gap: 1rem;
}

.th-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--th-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.th-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.th-btn-primary {
    background: linear-gradient(135deg, var(--th-primary), var(--th-secondary));
    color: white;
}

.th-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.th-btn-outline {
    background: transparent;
    border: 2px solid var(--th-border);
    color: var(--th-light);
}

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

/* Hero */
.th-hero {
    padding: 10rem 2rem 6rem;
    text-align: center;
    background: linear-gradient(180deg, var(--th-dark) 0%, var(--th-darker) 100%);
    position: relative;
    overflow: hidden;
}

.th-hero-small {
    padding: 8rem 2rem 3rem;
}

.th-hero-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: th-pulse 4s ease-in-out infinite;
}

@keyframes th-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.th-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.th-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--th-light), var(--th-primary), var(--th-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.th-hero p {
    font-size: 1.25rem;
    color: var(--th-gray);
    margin-bottom: 2rem;
}

.th-search-box {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.th-search-box input {
    width: 100%;
    padding: 1.2rem 3rem 1.2rem 1.5rem;
    border-radius: 1rem;
    border: 2px solid var(--th-border);
    background: var(--th-card-bg);
    color: var(--th-light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

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

.th-search-box i {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--th-gray);
}

.th-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.th-stat-item {
    text-align: center;
}

.th-stat-item h3 {
    font-size: 2rem;
    color: var(--th-primary);
}

.th-stat-item p {
    color: var(--th-gray);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Tools Section */
.th-tools-section {
    padding: 4rem 2rem;
}

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

.th-section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.th-section-header p {
    color: var(--th-gray);
    font-size: 1.1rem;
}

.th-categories {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.th-category-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    border: 2px solid var(--th-border);
    background: transparent;
    color: var(--th-gray);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.th-category-btn.active,
.th-category-btn:hover {
    background: var(--th-primary);
    border-color: var(--th-primary);
    color: white;
}

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

.th-tool-card {
    background: var(--th-card-bg);
    border: 1px solid var(--th-border);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s;
    cursor: pointer;
}

.th-tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--th-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.th-tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.th-tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

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

.th-tool-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--th-primary);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Tool Interface */
.th-tool-interface {
    display: none;
    padding: 8rem 0 4rem;
}

.th-tool-interface.active {
    display: block;
}

.th-back-btn {
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--th-gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.th-back-btn:hover {
    color: var(--th-primary);
}

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

.th-tool-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.th-tool-header p {
    color: var(--th-gray);
}

.th-tool-box {
    background: var(--th-card-bg);
    border: 1px solid var(--th-border);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.th-input-group {
    margin-bottom: 1.5rem;
}

.th-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.th-input-group textarea,
.th-input-group input[type="text"] {
    width: 100%;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid var(--th-border);
    background: var(--th-dark);
    color: var(--th-light);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.th-input-group textarea:focus,
.th-input-group input[type="text"]:focus {
    border-color: var(--th-primary);
}

.th-input-group textarea {
    min-height: 200px;
    resize: vertical;
}

.th-btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.th-result-box {
    background: var(--th-dark);
    border: 2px solid var(--th-border);
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 150px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    position: relative;
}

.th-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--th-primary);
    color: white;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.th-copy-btn:hover {
    background: var(--th-primary-dark);
}

/* Slider */
.th-slider-container {
    margin: 1rem 0;
}

.th-slider-container input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
    accent-color: var(--th-primary);
}

.th-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.th-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.th-checkbox-group input[type="checkbox"] {
    accent-color: var(--th-primary);
    width: 18px;
    height: 18px;
}

/* Stats Grid (Word Counter) */
.th-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.th-stat-card {
    background: var(--th-dark);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
}

.th-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--th-primary);
}

.th-stat-label {
    color: var(--th-gray);
    font-size: 0.9rem;
}

/* Color Inputs */
.th-color-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.th-color-preview {
    width: 100%;
    height: 100px;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border: 2px solid var(--th-border);
    transition: background 0.3s;
}

/* Footer */
.th-footer {
    background: var(--th-dark);
    border-top: 1px solid var(--th-border);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.th-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: var(--th-container);
    margin: 0 auto;
}

.th-footer-section h4 {
    margin-bottom: 1rem;
    color: var(--th-light);
    font-size: 1.1rem;
}

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

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

.th-footer-section a {
    color: var(--th-gray);
    text-decoration: none;
    transition: color 0.3s;
    cursor: pointer;
}

.th-footer-section a:hover {
    color: var(--th-primary);
}

.th-footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--th-border);
    color: var(--th-gray);
    max-width: var(--th-container);
    margin-left: auto;
    margin-right: auto;
}

/* Toast */
.th-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--th-success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transform: translateX(150%);
    transition: transform 0.3s;
    z-index: 9999;
}

.th-toast.show {
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .th-hero h1 {
        font-size: 2rem;
    }

    .th-nav {
        display: none;
    }

    .th-mobile-toggle {
        display: block;
    }

    .th-stats {
        gap: 1.5rem;
    }

    .th-tools-grid {
        grid-template-columns: 1fr;
    }

    .th-btn-group {
        flex-direction: column;
    }

    .th-btn-group .th-btn {
        width: 100%;
        justify-content: center;
    }

    .th-checkbox-group {
        grid-template-columns: 1fr;
    }

    .th-color-inputs {
        grid-template-columns: 1fr;
    }

    .th-header-btns {
        display: none;
    }
}

/* Admin Styles */
.toolhub-demo-import {
    max-width: 800px;
}

.toolhub-demo-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toolhub-demo-card h2 {
    margin-top: 0;
}

.toolhub-demo-card ul {
    list-style: none;
    padding: 0;
}

.toolhub-demo-card ul li {
    padding: 0.5rem 0;
    color: #3c434a;
}

.toolhub-demo-card ul li i {
    color: #22c55e;
    margin-right: 0.5rem;
}

.toolhub-demo-card .button-hero {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    height: auto;
}
