* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #7c3aed;
    --blue: #3b82f6;
    --green: #10b981;
    --purple: #a855f7;
    --pink: #ec4899;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background: var(--gray-900);
    color: white;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
}

body.dark-mode header {
    background: rgba(17, 24, 39, 0.7);
    border-color: var(--gray-700);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

body.dark-mode .search-container {
    background: rgba(31, 41, 55, 0.4);
    border-color: var(--gray-700);
}

#searchInput {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    width: 200px;
}

#searchInput::placeholder {
    color: var(--gray-500);
}

.btn {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1.25rem;
}

body.dark-mode .btn {
    background: rgba(31, 41, 55, 0.4);
    border-color: var(--gray-700);
}

.btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-btn {
    display: none;
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }
    .search-btn {
        display: flex;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    padding-top: 5rem;
    z-index: 30;
    transition: transform 0.3s;
}

body.dark-mode .sidebar {
    background: rgba(17, 24, 39, 0.95);
    border-color: var(--gray-700);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-content {
    padding: 1.5rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid transparent;
    font-size: 0.95rem;
}

body.dark-mode .nav-item {
    background: rgba(31, 41, 55, 0.4);
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), #d946ef);
    color: white;
    font-weight: bold;
}

.nav-item span:first-child {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
}

/* Main Content */
main {
    margin-left: 280px;
    min-height: 100vh;
    padding: 2rem;
}

body.dark-mode main {
    background: var(--gray-900);
}

@media (max-width: 768px) {
    main {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar.hidden ~ main {
        margin-left: 0;
    }
}

.content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile Search */
.mobile-search {
    display: none;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

body.dark-mode .mobile-search {
    background: rgba(31, 41, 55, 0.4);
    border-color: var(--gray-700);
}

@media (max-width: 768px) {
    .mobile-search {
        display: flex;
    }

    .mobile-search input {
        background: transparent;
        border: none;
        outline: none;
        width: 100%;
        color: inherit;
    }
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #9333ea, #ec4899, #f43f5e);
    color: white;
    border-radius: 1.5rem;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.stat-box .number {
    font-size: 2rem;
    font-weight: bold;
}

.stat-box .label {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Section */
.section {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

body.dark-mode .section {
    background: rgba(31, 41, 55, 0.4);
    border-color: var(--gray-700);
}

.section h2 {
    font-size: 1.875rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section p {
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.section p:last-child {
    margin-bottom: 0;
}

/* Category Banner */
.category-banner {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.category-banner h2 {
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.category-banner .icon {
    font-size: 2.5rem;
}

.category-banner p {
    opacity: 0.9;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.dark-mode .project-card {
    background: rgba(31, 41, 55, 0.4);
    border-color: var(--gray-700);
}

.project-card:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s;
}

.project-card:hover .project-icon {
    transform: scale(1.25);
}

.project-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.3;
    min-height: 2rem;
}

.project-desc {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    min-height: 1.8rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s;
}

.tag:hover {
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-content {
    background: var(--gray-800);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: white;
    padding: 2rem;
    border-radius: 1.5rem 1.5rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-header-content {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.modal-icon {
    font-size: 3rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    font-weight: bold;
    margin-bottom: 1rem;
}

.tag-list-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-modal {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: medium;
    cursor: pointer;
    transition: all 0.3s;
}

.tag-modal:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.version-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    background: var(--gray-100);
    margin-bottom: 0.5rem;
}

body.dark-mode .version-link {
    background: var(--gray-700);
}

.version-link:hover {
    background: var(--gray-200);
    transform: translateX(4px);
}

body.dark-mode .version-link:hover {
    background: var(--gray-600);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    z-index: 50;
}

.scroll-to-top.show {
    display: flex;
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Footer */
footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-600);
    margin-top: 3rem;
    margin-left: 280px;
}

body.dark-mode footer {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--gray-400);
}

@media (max-width: 768px) {
    footer {
        margin-left: 0;
    }
}

/* Tag Colors */
.tag-chatgpt { background: #dcfce7; color: #166534; }
body.dark-mode .tag-chatgpt { background: #064e3b; color: #86efac; }

.tag-gemini { background: #dbeafe; color: #1e3a8a; }
body.dark-mode .tag-gemini { background: #0c2340; color: #93c5fd; }

.tag-claude { background: #f3e8ff; color: #5b21b6; }
body.dark-mode .tag-claude { background: #3f0f5c; color: #e9d5ff; }

.tag-grok { background: #fee2e2; color: #7f1d1d; }
body.dark-mode .tag-grok { background: #3f0505; color: #fca5a5; }

.tag-perplexity { background: #fed7aa; color: #92400e; }
body.dark-mode .tag-perplexity { background: #3e2723; color: #ffb380; }

.tag-googleaistudio { background: #fef3c7; color: #78350f; }
body.dark-mode .tag-googleaistudio { background: #402500; color: #fef08a; }

.tag-copilot { background: #e0e7ff; color: #312e81; }
body.dark-mode .tag-copilot { background: #1a1a3f; color: #a5b4fc; }

.tag-myself { background: #cffafe; color: #164e63; }
body.dark-mode .tag-myself { background: #061f2e; color: #67e8f9; }

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state p {
    font-size: 1.1rem;
}