/* 在线自习室样式优化 - 专注于提升用户体验与视觉效果 */

/* 自习室网格布局 */
.study-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    max-width: 100%;
}

/* 自习室卡片基础样式 */
.study-room-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 自习室卡片悬停效果 */
.study-room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border-color: #3b82f6;
    background: #ffffff;
}

/* 自习室卡片选中状态 */
.study-room-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #ffffff;
}

/* 自习室头部样式 */
.study-room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* 自习室标题样式 */
.study-room-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

/* 自习室图标样式 */
.study-room-title i {
    font-size: 1.25rem;
    color: #3b82f6;
}

/* 在线人数标签样式 */
.online-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    margin-top: auto;
}

/* 自习室描述样式 */
.study-room-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 2rem; /* 为在线人数标签留出空间 */
}

/* 当前学习区域样式 */
.current-study-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
}

/* 学习状态提示信息 */
.study-status-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: 1rem;
}

/* 控制按钮容器样式 */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    flex-wrap: wrap;
}

/* 控制按钮通用样式 */
.control-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 120px;
}

/* 响应式布局调整 */
@media (max-width: 640px) {
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-button {
        width: 100%;
        max-width: 200px;
    }
}

/* 确保在大屏幕上按钮不会太宽 */
@media (min-width: 768px) {
    .control-buttons {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

.study-status-message strong {
    color: #3b82f6;
    font-size: 1.125rem;
}

/* 用户列表容器 */
.user-list-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* 用户项样式 */
.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.user-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 用户信息容器 */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 用户头像样式 */
.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.875rem;
}

/* 用户详情样式 */
.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* 用户活动状态 */
.user-activity {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

/* 用户专注时长 */
.user-focus-time {
    font-size: 0.75rem;
    color: #64748b;
}

/* 专注状态指示器 */
.focus-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
}

/* 专注中状态 */
.focus-indicator.focused {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

/* 控制按钮容器 */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* 控制按钮样式 */
.control-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.control-button:hover {
    transform: translateY(-1px);
}

/* 学习中状态标识 */
.study-in-progress {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 0.5rem rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .study-room-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .control-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .control-button {
        width: 100%;
    }
    
    .user-list-container {
        max-height: 300px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .study-room-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .study-room-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .study-room-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .study-room-card:hover {
        border-color: #60a5fa;
    }
    
    .study-room-card.selected {
        border-color: #60a5fa;
        box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
        background: linear-gradient(to bottom right, #1e293b, #0f172a);
    }
    
    /* 深色模式下不同类型自习室的背景色 */
    .study-room-card[data-room-type="resume-optimization"] {
        background: linear-gradient(135deg, #1e293b, #0f172a);
    }
    
    .study-room-card[data-room-type="email-editing"] {
        background: linear-gradient(135deg, #1e293b, #1c1917);
    }
    
    .study-room-card[data-room-type="literature-reading"] {
        background: linear-gradient(135deg, #1e293b, #0f172a);
    }
    
    .study-room-card[data-room-type="research-planning"] {
        background: linear-gradient(135deg, #1e293b, #1c1917);
    }
    
    .study-room-card[data-room-type="leisure-area"] {
        background: linear-gradient(135deg, #1e293b, #292524);
    }
    
    .study-room-title {
        color: #f8fafc;
    }
    
    .study-room-description {
        color: #94a3b8;
    }
    
    .current-study-section {
        background: #0f172a;
        border-color: #334155;
    }
    
    .study-status-message {
        color: #94a3b8;
    }
    
    .study-status-message strong {
        color: #60a5fa;
    }
    
    .user-item {
        background: #1e293b;
        border-color: #334155;
    }
    
    .user-item:hover {
        border-color: #475569;
    }
    
    .user-activity {
        color: #f8fafc;
    }
    
    .user-focus-time {
        color: #94a3b8;
    }
    
    .control-buttons {
        border-top-color: #334155;
    }
    
    .control-button.bg-white {
        background: #334155;
        color: #f8fafc;
        border-color: #475569;
    }
    
    .control-button.bg-white:hover {
        background: #475569;
    }
}

/* 计时器容器样式 */
.timer-container {
    text-align: center;
    padding: 2rem;
}

/* 房间信息样式 */
.room-info {
    margin-bottom: 2rem;
}

.room-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.room-info p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* 计时器显示区域样式 */
.timer-display {
    margin-bottom: 1.5rem;
}

/* 计时器数字样式 */
.timer {
    font-size: 3rem;
    font-weight: 700;
    color: #3b82f6;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

/* 状态信息样式 */
.status-info {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background-color: #f3f4f6;
    font-size: 0.875rem;
}

.status-info i {
    font-size: 0.5rem;
}

/* 计时器提示信息样式 */
.timer-tip {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.timer-tip i {
    color: #6b7280;
    margin-right: 0.25rem;
}

/* 深色模式下计时器样式 */
@media (prefers-color-scheme: dark) {
    .room-info h3 {
        color: #f8fafc;
    }
    
    .room-info p {
        color: #94a3b8;
    }
    
    .timer {
        color: #60a5fa;
    }
    
    .status-info {
        background-color: #334155;
    }
    
    .status-info .text-neutral-500 {
        color: #94a3b8;
    }
    
    .status-info .text-green-600 {
        color: #34d399;
    }
}

/* 响应式设计 - 计时器 */
@media (max-width: 640px) {
    .timer {
        font-size: 2.25rem;
    }
    
    .timer-container {
        padding: 1.5rem 1rem;
    }
}

/* 确保在小屏幕上计时器显示正确 */
@media (max-width: 480px) {
    .timer {
        font-size: 1.75rem;
        letter-spacing: 0.05em;
    }
    
    .room-info h3 {
        font-size: 1.125rem;
    }
}