/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background-color: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
}

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

.nav-menu li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu li a::before {
    content: attr(data-icon);
    font-size: 1.2rem;
}

.nav-menu li a:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
    transform: translateY(-2px);
}

/* Header Buttons */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bookmark-btn,
.share-btn,
.theme-toggle {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.bookmark-btn::before,
.share-btn::before,
.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.bookmark-btn:hover,
.share-btn:hover,
.theme-toggle:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.bookmark-btn:hover::before,
.share-btn:hover::before,
.theme-toggle:hover::before {
    opacity: 1;
}

.bookmark-btn:active,
.share-btn:active,
.theme-toggle:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.btn-icon,
.theme-icon {
    font-size: 18px;
    line-height: 1;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    z-index: 2;
}

.theme-icon.sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-icon.moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg) scale(0.8);
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg) scale(0.8);
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.theme-toggle:hover::after {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0.1;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger {
    width: 24px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-btn.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: absolute;
    top: 80px;
    left: 20px;
    right: 20px;
    background-color: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active .mobile-nav {
    transform: translateY(0);
}

.mobile-menu {
    list-style: none;
    padding: 1rem 0;
}

.mobile-menu li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.mobile-menu li a::before {
    content: attr(data-icon);
    font-size: 1.2rem;
}

.mobile-menu li:last-child a {
    border-bottom: none;
}

.mobile-menu li a:hover {
    background-color: var(--bg-hover);
    transform: translateX(10px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding-bottom: 4rem;
}

/* Hero Section */
.hero-section {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 1.33rem 0 0.44rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, var(--accent-color)08 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--accent-color)05 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, var(--accent-color)03 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Enhanced text visibility */
[data-theme="dark"] .hero-title {
    color: #f8fafc;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .hero-title {
    color: #1e293b;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.5);
}

/* System dark theme support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .hero-title {
        color: #f8fafc;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .hero-subtitle {
    color: #cbd5e1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .hero-subtitle {
    color: #64748b;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* System dark theme support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .hero-subtitle {
        color: #cbd5e1;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: left;
}

[data-theme="dark"] .hero-description {
    color: #e2e8f0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .hero-description {
    color: #334155;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* System dark theme support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .hero-description {
        color: #e2e8f0;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

.hero-description p {
    margin-bottom: 1rem;
}

/* Hero description enhanced styles */
.hero-description .gradient-text {
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.hero-description .highlight-red {
    color: #ef4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    font-weight: bold;
}

.hero-description .highlight-blue {
    color: #3b82f6 !important;
    font-weight: bold;
}

.hero-description .highlight-green {
    color: #10b981 !important;
    font-weight: bold;
}

/* Dark theme adjustments for hero description */
[data-theme="dark"] .hero-description .gradient-text {
    background: linear-gradient(120deg, #10d9c4 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .hero-description .highlight-red {
    color: #f87171 !important;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.4);
}

[data-theme="dark"] .hero-description .highlight-blue {
    color: #60a5fa !important;
}

[data-theme="dark"] .hero-description .highlight-green {
    color: #34d399 !important;
}

/* Section Styles */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Links Section */
.links-section {
    padding: 1.33rem 0;
}

.update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.last-update {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-indicator.active {
    background-color: #10b981;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 100%;
}

/* Desktop 4-column layout */
@media (min-width: 1024px) {
    .links-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem;
    }
}

.link-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.link-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.status-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.available {
    background-color: #dcfce7;
    color: #166534;
}

[data-theme="dark"] .status-badge.available {
    background-color: #064e3b;
    color: #4ade80;
}

.domain-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 0.75rem;
}

.link-group {
    margin-bottom: 0.75rem;
}

.link-group:last-of-type {
    margin-bottom: 0;
}

.link-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.main-link,
.backup-link {
    display: inline-block;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.8rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.main-link {
    background-color: var(--accent-color);
    color: white;
}

.main-link:hover {
    background-color: var(--accent-hover);
    transform: translateX(5px);
}

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

.backup-link:hover {
    background-color: var(--bg-hover);
    transform: translateX(5px);
}

.external-icon {
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.response-time {
    color: var(--accent-color);
    font-weight: 600;
}

/* Important Notes */
.important-notes {
    display: grid;
    gap: 1.5rem;
}

.note-card {
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid;
}

.note-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.note-card.warning {
    background-color: #fef3cd;
    border-color: #f59e0b;
    color: #92400e;
}

.note-card.info {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.note-card.tip {
    background-color: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

[data-theme="dark"] .note-card.warning {
    background-color: #451a03;
    color: #fbbf24;
}

[data-theme="dark"] .note-card.info {
    background-color: #1e3a8a;
    color: #93c5fd;
}

[data-theme="dark"] .note-card.tip {
    background-color: #064e3b;
    color: #6ee7b7;
}

.note-card ul {
    padding-left: 1.5rem;
}

.note-card li {
    margin-bottom: 0.5rem;
}

/* Help Section */
.help-section {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.faq-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.faq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.faq-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.faq-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* History Section */
.history-section {
    padding: 4rem 0;
}

.history-content {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 2rem;
    min-height: 300px;
}

.history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* About Section */
.about-section {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
}

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

.about-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.about-card h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-card p,
.about-card ul {
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-card ul {
    padding-left: 1.5rem;
}

.about-card li {
    margin-bottom: 0.5rem;
}

/* Scroll Buttons */
.scroll-buttons {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.scroll-btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 16px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.scroll-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.scroll-btn:hover {
    color: white;
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3);
}

.scroll-btn:hover::before {
    opacity: 1;
}

.scroll-btn span {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.scroll-btn:hover span {
    transform: scale(1.1);
}

/* Scroll button visibility states */
.scroll-btn.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.scroll-btn:active {
    transform: scale(0.95) translateY(0);
    transition: all 0.1s ease;
}

/* Dark mode specific styling */
[data-theme="dark"] .scroll-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .scroll-btn:hover {
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.4);
}

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

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

.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.links-grid-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.footer-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid var(--border-color);
}

.footer-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

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

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-link-bottom {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-link-bottom:hover {
    color: var(--text-primary);
}

/* Utility Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Academic Tools Section */
.tools-section {
    padding: 0.67rem 0 4rem 0;
    background: var(--bg-primary);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 400;
}

.tool-category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: left;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-color);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: start;
    justify-items: stretch;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 140px;
    position: relative;
    cursor: pointer;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

.tool-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-icon {
    font-size: 1.25rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    flex-shrink: 0;
}

.tool-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tool-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tool-links {
    margin-top: auto;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    min-width: 50px;
    justify-content: center;
    flex-shrink: 0;
}

.tool-link:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.tool-link.primary {
    background: var(--accent-color);
}

.tool-link.primary:hover {
    background: var(--accent-hover);
}

/* Dark theme specific adjustments */
[data-theme="dark"] .tool-icon {
    background: var(--accent-light);
    color: var(--accent-color);
}

[data-theme="light"] .tool-icon {
    background: var(--accent-light);
    color: var(--accent-color);
}

/* System dark theme support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .tool-icon {
        background: var(--accent-light);
        color: var(--accent-color);
    }
}

/* Tooltip Styles */
.tool-card[data-tooltip] {
    position: relative;
    z-index: 1;
}

.tool-card[data-tooltip]:hover {
    z-index: 999999999;
}

.tool-card[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    width: 300px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 999999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.tool-card[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
}


.tool-card[data-tooltip]::before {
    content: '';
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.95);
    z-index: 999999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    isolation: isolate;
}

.tool-card[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar.open {
    left: 0;
}

.sidebar-content {
    padding: 0;
    height: 100%;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 1rem 0;
}

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

.nav-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.nav-list li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.nav-link.active {
    background-color: var(--accent-light);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    font-weight: 500;
}

/* Sidebar Toggle Button */
.sidebar-btn {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 1050;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.sidebar-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-50%) scale(1.05);
}

.sidebar-btn svg {
    width: 20px;
    height: 20px;
}

/* Content Wrapper */
.content-wrapper {
    transition: margin-left 0.3s ease;
}

.content-wrapper.sidebar-open {
    margin-left: 320px;
}

/* Main Content */
.main-content {
    min-height: 100vh;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 300px;
        left: -300px;
    }

    .sidebar.open {
        left: 0;
    }

    .content-wrapper.sidebar-open {
        margin-left: 0;
    }

    .sidebar-btn {
        left: 15px;
        width: 44px;
        height: 44px;
    }

    .sidebar-btn svg {
        width: 18px;
        height: 18px;
    }
}