/* 暗涌 Final Clone - 基于精确分析的样式 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 用户信息区域样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 16px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-phone {
    color: rgb(255, 255, 255);
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}

.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-button .material-icons {
    color: rgb(255, 255, 255);
    font-size: 18px;
    opacity: 0.8;
}

.logout-button:hover .material-icons {
    opacity: 1;
}

/* Body - 基于真实分析 */
body.mat-app-background.dark-theme {
    font-family: "Google Sans Text", "Google Sans", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: rgb(255, 255, 255);
    background-color: rgb(19, 19, 20);
    width: 100vw;
    height: 100vh;
    overflow-x: hidden;
}

/* App Body Container - 基于真实分析 */
labs-tailwind-root {
    display: block;
    width: 100%;
    height: 100vh;
}

/* App Body - 基于真实分析 */
.app-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    background-color: transparent;
}

/* Welcome Page Container - 基于真实分析 */
.welcome-page-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-color: rgb(34, 38, 43);
    padding-top: 0; /* 移除Google One Bar后无需padding */
}

/* Page Header (顶部导航) - 基于真实分析 */
.welcome-page-navbar {
    position: fixed;
    top: 0; /* 直接贴顶显示 */
    left: 0;
    right: 0;
    height: 64px;
    background-color: rgb(34, 38, 43);
    z-index: 999;
    display: flex;
    align-items: center;
}

.navbar-content {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 60px 0 180px; /* 左边距180px，右边距60px */
    display: flex;
    align-items: center;
    justify-content: space-between; /* logo在左，其他在右 */
}

/* Logo样式 */
.navbar-logo {
    display: flex;
    align-items: center;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.app-logo:hover {
    opacity: 0.8;
}

.app-logo .material-icons {
    font-size: 28px;
    color: rgb(168, 199, 250);
}

.app-logo .logo-text {
    font-size: 20px;
    font-weight: 600;
    color: rgb(255, 255, 255);
    font-family: 'Google Sans', sans-serif;
}

/* 右侧控制区域容器 */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.settings-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background-color: transparent;
    border: none;
    border-radius: 16px;
    color: rgb(255, 255, 255);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.settings-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.settings-button .material-icons {
    font-size: 18px;
}

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

.nav-tabs {
    display: flex;
    gap: 8px;
}

.nav-tab {
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid rgb(168, 199, 250);
    border-radius: 12px;
    color: rgb(194, 231, 255);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    background-color: rgba(168, 199, 250, 0.1);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-controls {
    display: flex;
    gap: 4px;
}

.view-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.view-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.view-toggle.active {
    background-color: rgba(168, 199, 250, 0.2);
}

.view-toggle .material-icons {
    font-size: 20px;
    color: rgb(194, 231, 255);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    color: rgb(227, 227, 227);
    font-size: 14px;
    font-weight: 500;
}

.sort-dropdown {
    background: none;
    border: none;
    cursor: pointer;
}

.sort-dropdown .material-icons {
    font-size: 20px;
    color: rgb(227, 227, 227);
}

.add-button {
    width: 40px;
    height: 40px;
    border: none;
    background-color: rgb(168, 199, 250);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-button:hover {
    background-color: rgb(171, 200, 250);
    transform: scale(1.05);
}

.add-button .material-icons {
    font-size: 20px;
    color: rgb(26, 29, 34);
}

/* Category Navigation */
.category-navigation {
    padding: 24px 180px 0 180px;
    margin-bottom: 32px;
}

.category-tabs {
    display: flex;
    gap: 32px;
    align-items: center;
}

.category-tab {
    background: none;
    border: none;
    color: rgb(154, 160, 166);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
    font-family: 'Google Sans', sans-serif;
}

.category-tab:hover {
    color: rgb(227, 227, 227);
}

.category-tab.active {
    color: rgb(255, 255, 255);
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgb(168, 199, 250);
    border-radius: 1px;
}

/* Main Content Area - 基于真实分析 */
.all-projects-container {
    flex: 1;
    width: 100%;
    max-width: 1428px;
    margin: 0 auto;
    padding: 128px 0 32px 0; /* 顶部padding考虑固定导航栏(64px)和分类导航(64px) */
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Section Headers */
.featured-projects-header,
.projects-header {
    margin-bottom: 16px;
    padding: 0 180px;
}

.featured-projects-header h2,
.projects-header h2 {
    color: rgb(255, 255, 255);
    font-size: 18px;
    font-weight: 500;
    font-family: "Google Sans Text", "Google Sans", sans-serif;
}

/* Project Buttons Flow - 基于真实分析的网格 */
.project-buttons-flow {
    display: grid;
    grid-template-columns: repeat(5, 260px); /* 精确的260px列宽 */
    gap: 32px; /* 精确的32px间距 */
    justify-content: start;
    padding: 0 180px;
}

.featured-projects-flow {
    grid-template-columns: repeat(3, 260px); /* Featured只显示3列 */
}

/* MAT-CARD - 基于真实分析 */
.mat-mdc-card.mdc-card.project-button-card {
    width: 260px;
    height: 224px;
    background-color: rgb(50, 52, 62);
    border: 1px solid rgb(60, 64, 67);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mat-mdc-card.mdc-card.project-button-card:hover {
    background-color: rgb(55, 57, 67);
    border-color: rgb(168, 199, 250);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Featured Project Cards */
.featured-project-card {
    background-color: rgb(47, 51, 75);
    border-color: rgb(55, 59, 83);
}

.featured-project-card:hover {
    background-color: rgb(52, 56, 80);
    border-color: rgb(168, 199, 250);
}

/* Create Project Card */
.create-project-card {
    border: 2px dashed rgb(168, 199, 250);
    background-color: rgba(168, 199, 250, 0.05);
}

.create-project-card:hover {
    background-color: rgba(168, 199, 250, 0.1);
    border-color: rgb(171, 200, 250);
}

/* Card Content */
.card-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.project-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: rgba(168, 199, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-icon .material-icons {
    font-size: 20px;
    color: rgb(168, 199, 250);
}

.notebook-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notebook-emoji {
    font-size: 24px;
}

.create-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(168, 199, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.create-icon .material-icons {
    font-size: 24px;
    color: rgb(168, 199, 250);
}

.create-text {
    color: rgb(168, 199, 250);
    font-size: 14px;
    font-weight: 500;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-title {
    color: rgb(255, 255, 255);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-subtitle {
    color: rgb(195, 198, 214);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.project-meta {
    display: flex;
    align-items: center;
    color: rgb(195, 198, 214);
    font-size: 12px;
    margin-top: auto;
}

.project-date {
    color: rgb(195, 198, 214);
}

.project-separator {
    margin: 0 4px;
    color: rgb(195, 198, 214);
}

.project-sources {
    color: rgb(195, 198, 214);
}

.project-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.mat-mdc-card:hover .project-menu {
    opacity: 1;
}

.project-menu:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.project-menu .material-icons {
    font-size: 16px;
    color: rgb(227, 227, 227);
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .project-buttons-flow {
        grid-template-columns: repeat(4, 260px);
    }
}

@media (max-width: 1300px) {
    .project-buttons-flow {
        grid-template-columns: repeat(3, 260px);
    }
    
    .featured-projects-flow {
        grid-template-columns: repeat(3, 260px);
    }
}

@media (max-width: 1000px) {
    .navbar-content {
        padding: 0 32px;
    }
    
    .all-projects-container {
        padding: 98px 32px 32px;
    }
    
    .project-buttons-flow {
        grid-template-columns: repeat(2, 260px);
        justify-content: center;
    }
    
    .featured-projects-flow {
        grid-template-columns: repeat(2, 260px);
    }
}

@media (max-width: 768px) {
    .navbar-content {
        padding: 0 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .navbar-right {
        gap: 8px;
    }
    
    .all-projects-container {
        padding: 98px 16px 32px;
    }
    
    .project-buttons-flow {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .featured-projects-flow {
        grid-template-columns: 1fr;
    }
    
    .mat-mdc-card.mdc-card.project-button-card {
        width: 100%;
        max-width: 320px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(34, 38, 43);
}

::-webkit-scrollbar-thumb {
    background: rgb(60, 64, 67);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(80, 84, 87);
}

/* 焦点样式 */
button:focus-visible {
    outline: 2px solid rgb(168, 199, 250);
    outline-offset: 2px;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mat-mdc-card {
    animation: fadeInUp 0.3s ease-out;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 选中状态 */
.mat-mdc-card.selected {
    border-color: rgb(168, 199, 250);
    background-color: rgba(168, 199, 250, 0.1);
}

/* 禁用状态 */
.mat-mdc-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Add Sources Modal Overlay */
.add-sources-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.add-sources-iframe {
    width: 90vw;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    border-radius: 16px;
    background-color: rgb(32, 33, 36);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mat-mdc-card:disabled:hover {
    transform: none;
    box-shadow: none;
}
