:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-input: #0d0d12;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent-primary: #b9ff49;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #32d5fd 0%, #79f731 100%);
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --border-color: #2a2a3a;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
}

.light-mode {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f0f5;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --border-color: #e0e0e8;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow selection in input areas */
input, textarea, [contenteditable="true"], .result-content {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
}

.logo i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo:hover {
    opacity: 0.8;
}

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

.back-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.back-btn.visible {
    display: flex;
}

.all-tools-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    color: #000;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.all-tools-btn:hover {
    background: transparent;
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.theme-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.hamburger-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: var(--bg-secondary);
}

.hero h1 {
    font-size: 3.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Section */
.tool-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding-top: 1rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 99;
    transition: transform 0.3s ease;
    transform: translateX(0);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

.sidebar.mobile-closed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 0 1.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.sidebar-note {
    padding: 0 1.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-tools {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-tools li {
    margin: 0;
}

.sidebar-tools a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
}

.sidebar-tools a:hover {
    background: rgba(185, 255, 73, 0.1);
    color: var(--accent-primary);
    padding-left: 2rem;
}

.sidebar-tools a.active {
    background: rgba(185, 255, 73, 0.15);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
    padding-left: calc(1.5rem - 3px);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
}

.sidebar-overlay.visible {
    display: block;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

body.sidebar-open main {
    margin-left: 250px;
    padding: 2rem 1.5rem;
}

/* Tool Container */
.tool-container {
    max-width: 700px;
    margin: 0 auto !important;
    padding: 0 !important;
}

.tool-header {
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    padding-bottom: 2rem !important;
    border-bottom: 2px solid var(--border-color);
    width: 100%;
    display: block;
}

.tool-header .tool-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1.5rem !important;
    padding: 0 !important;
}

.tool-header h2 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0 !important;
    font-weight: 700;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto !important;
    white-space: pre-line;
}

.tool-ad-space {
    margin: 2.5rem auto;
    padding: 1.5rem 0;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
}

/* Form Elements */
label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

textarea, input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    resize: vertical;
}

textarea {
    min-height: 140px;
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

input[type="color"] {
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: transform 0.2s;
}

input[type="color"]:hover {
    transform: scale(1.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-success {
    background: var(--accent-success);
    color: white;
}

.btn-warning {
    background: var(--accent-warning);
    color: white;
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-xs {
    padding: 6px 8px;
    font-size: 11px;
}

/* Result Box */
.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.result-box .result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-box .result-content {
    color: var(--text-primary);
    word-break: break-word;
    font-size: 1.05rem;
    line-height: 1.6;
}

.result-box pre {
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    font-size: 0.85rem;
    line-height: 1.4;
}

.copy-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Input Groups */
.input-group {
    margin-bottom: 1rem;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Color Preview */
.color-preview {
    height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Footer */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.footer-links span {
    color: var(--border-color);
}

/* SEO Content */
.seo-content {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    margin-top: 30px;
    color: var(--text-primary);
}

.seo-content h3 {
    font-size: 1.4rem;
    margin: 30px 0 15px 0;
    color: var(--text-primary);
}

.seo-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.seo-faq {
    margin-top: 40px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--accent-primary);
}

.faq-question {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 20px 18px 20px;
}

/* Checkbox/Radio Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: normal;
}

/* Home Page Grid */
.home-header {
    text-align: center;
    margin-bottom: 3rem;
}

.home-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Tools Grid */
.tools-grid,
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.tool-card i {
    font-size: 2.5rem;
    color: var(--accent-primary);
    transition: transform 0.3s;
}

.tool-card:hover i {
    transform: scale(1.1);
}

.tool-card span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-card-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
}

.tool-card-preview:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.tool-card-preview .tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

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

.tool-card-preview p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card-preview .tool-category {
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .home-header h1 {
        font-size: 1.8rem;
    }

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

    .tool-content {
        padding: 1.25rem;
    }

    .tool-header h2 {
        font-size: 1.5rem;
    }

    .hamburger-btn {
        display: flex;
    }

    body.sidebar-open main {
        margin-left: 0;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

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

    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    main {
        padding: 1rem;
    }

    .category-filter {
        gap: 0.35rem;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .tool-header h2 {
        font-size: 1.3rem;
    }
}

/* Notification */
#notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

#notification.show {
    opacity: 1;
    transform: translateY(0);
}
