/* ASMR Website CSS Variables */
:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --accent-color: #7579e7;
    --text-color: #e2e2e2;
    --card-bg: #242442;
    --card-hover: #2c2c54;
    --tag-bg: #4a3f78;
    --tag-hover: #5a4f88;
    --tag-active: #7579e7;
}

/* Base Styles */
body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header Styles */
.header {
    background-color: var(--secondary-bg);
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-text {
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: none;
    padding: 0;
    gap: 0;
    width: 100%;
    margin-top: 0.5rem;
}

.nav-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    margin-bottom: -1px;
}

.nav-tab.active {
    background-color: var(--primary-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--primary-bg);
    z-index: 2;
}

.nav-tab:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tab:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--primary-bg) 100%);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #9ca3af;
    margin-bottom: 2rem;
}

.search-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Channel Styles */
.channel-header {
    background-color: var(--secondary-bg);
    border-radius: 1rem;
    padding: 1.5rem;
}

.channel-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background-color: var(--card-hover);
}

.channel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.channel-tag {
    background-color: var(--tag-bg);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    margin: 0.15rem;
    display: inline-block;
}

.channel-tag.active {
    background-color: var(--tag-active);
    color: white;
    font-weight: 500;
}

/* Video Styles */
.video-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background-color: var(--card-hover);
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.video-tag {
    background-color: var(--tag-bg);
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 9999px;
    margin: 0.1rem;
    display: inline-block;
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9のアスペクト比 */
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.video-card:hover .play-icon {
    background-color: rgba(255, 0, 0, 0.8);
    opacity: 1;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Tag Styles */
.tag-button {
    background-color: var(--tag-bg);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    border-radius: 9999px;
    padding: 0.4rem 0.8rem;
    margin: 0.15rem;
    color: var(--text-color);
    display: inline-block;
    text-decoration: none;
}

.tag-button:hover {
    background-color: var(--tag-hover);
    transform: translateY(-1px);
}

.tag-button.active {
    background-color: var(--tag-active);
    color: white;
    font-weight: 500;
    box-shadow: 0 0 8px rgba(117, 121, 231, 0.5);
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    background-color: var(--secondary-bg);
    border-radius: 0.5rem;
    padding: 0.75rem;
    gap: 0.2rem;
}

/* Button Styles */
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-youtube {
    background-color: #ff0000;
}

.search-link {
    background-color: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
    margin: 0.5rem;
}

.search-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.clear-button {
    background-color: #e74c3c;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.clear-button:hover {
    opacity: 0.9;
}

/* Category Section */
.category-section {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.category-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background-color: var(--card-hover);
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
    padding: 1rem 1rem 0 1rem;
}

.category-heading {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #9ca3af;
}

/* Search Info */
.search-info {
    background-color: var(--secondary-bg);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

/* Section Styles */
.section-title {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 1.5px;
}

.divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Description Text */
.description-text {
    white-space: pre-line;
    font-size: 0.9rem;
    color: rgba(226, 226, 226, 0.8);
}

/* Accordion Styles */
.accordion-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
}

.accordion-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 1100px;
    transition: max-height 0.5s ease;
}

.chevron {
    transition: transform 0.3s ease;
}

.accordion-header.active .chevron {
    transform: rotate(180deg);
}

/* Clear Tag Filter */
.clear-tag-filter {
    font-size: 0.85rem;
    color: rgba(226, 226, 226, 0.7);
    transition: all 0.2s ease;
}

.clear-tag-filter:hover {
    color: var(--accent-color);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 20px;
}

/* Media Queries */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .search-buttons {
        flex-direction: column;
        align-items: center;
    }

    .tag-button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        margin: 0.1rem;
    }

    .tag-container {
        padding: 0.5rem;
        gap: 0.1rem;
    }

    .category-title {
        font-size: 1rem;
        padding: 0.75rem 0.75rem 0 0.75rem;
    }

    .category-heading {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .channel-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    /* モバイルでは1列表示 */
    .max-w-4xl.mx-auto.grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .search-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
