/* ===== 画鱼页整体样式 ===== */
body {
    text-align: center;
    margin: 0;
    padding: 10px;
    position: relative;
    overflow-x: hidden;
}

/* 绘画区域整体居中 */
#drawing-section {
    text-align: center;
}

/* 页面主标题 */
#drawing-section h1 {
    font-size: 2.5em;
    color: #4F46E5;
    margin: 20px 0 10px;
    text-shadow: 2px 2px 4px rgba(99, 102, 241, 0.3);
    font-weight: 700;
}

#drawing-section h2 {
    font-size: 1.2em;
    color: #757575;
    margin: 0 0 30px;
    font-weight: 400;
}

/* Canvas styles */
#draw-canvas {
    border: none;
    background: #ffffff;
    cursor: crosshair;
    display: block;
    position: relative;
    z-index: 1;
}

/* 提交按钮容器 */
.submit-button-container {
    margin: 8px 0 10px;
    text-align: center;
}

.cute-submit-btn {
    font-size: 1.3em !important;
    padding: 16px 40px !important;
    animation: pulse 2s ease-in-out infinite !important;
}

.cute-submit-btn:hover {
    animation: heartbeat 0.8s ease-in-out !important;
}

/* 导航链接区域 */
.nav-links-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

/* ===== 鱼缸页样式 ===== */

/* 鱼缸容器 */
.tank-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, 
        #B2EBF2 0%, 
        #4FC3F7 30%, 
        #0288D1 70%, 
        #01579B 100%);
}

/* 鱼缸画布 */
#swim-canvas {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
    border: none;
    position: relative;
    z-index: 10;
}

/* 装饰层容器 */
.tank-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* 水草样式 */
.seaweed {
    position: absolute;
    bottom: 0;
    width: 60px;
    height: 200px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(76, 175, 80, 0.3) 20%, 
        rgba(76, 175, 80, 0.6) 100%);
    border-radius: 30px 30px 0 0;
    animation: sway 4s ease-in-out infinite;
    transform-origin: bottom center;
}

.seaweed::before,
.seaweed::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 40px;
    height: 150px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(76, 175, 80, 0.4) 30%, 
        rgba(76, 175, 80, 0.7) 100%);
    border-radius: 20px 20px 0 0;
    animation: sway 3.5s ease-in-out infinite;
    transform-origin: bottom center;
}

.seaweed::before {
    left: -25px;
    animation-delay: -0.5s;
}

.seaweed::after {
    right: -25px;
    animation-delay: -1s;
}

.seaweed-left {
    left: 50px;
    animation-delay: 0s;
}

.seaweed-right {
    right: 50px;
    animation-delay: -1.5s;
}

/* 底部沙地 */
.sand-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(180deg, 
        rgba(255, 224, 178, 0) 0%, 
        rgba(255, 224, 178, 0.6) 50%, 
        rgba(255, 193, 7, 0.8) 100%);
    z-index: 20;
}

/* 装饰物 */
.decoration {
    position: absolute;
    bottom: 60px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    z-index: 15;
}

.shell {
    left: 20%;
    background: radial-gradient(circle at 30% 30%, #FFE0B2, #FFAB91);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    animation: float 6s ease-in-out infinite;
}

.starfish {
    right: 25%;
    background: radial-gradient(circle at 30% 30%, #FFD54F, #FFA726);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkle 3s ease-in-out infinite;
}

.rock {
    left: 50%;
    bottom: 70px;
    width: 60px;
    height: 50px;
    background: linear-gradient(135deg, #90A4AE, #607D8B);
    border-radius: 60% 40% 30% 70% / 40% 60% 50% 60%;
}

/* 光线效果 */
.light-beams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
    overflow: hidden;
}

.light-beam {
    position: absolute;
    top: -50px;
    width: 80px;
    height: 300px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
    transform: skewX(-10deg);
    animation: lightbeam 4s ease-in-out infinite;
}

.light-beam:nth-child(1) {
    left: 20%;
}

.light-beam:nth-child(2) {
    left: 50%;
    animation-delay: 1.5s;
}

.light-beam:nth-child(3) {
    left: 75%;
    animation-delay: 3s;
}

/* 控制栏样式 */
.cute-controls-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    border-top: 3px solid #C7D2FE;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-label {
    font-size: 14px;
    font-weight: 600;
    color: #4F46E5;
}

.fish-count-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.count-detail {
    font-size: 12px;
    color: #757575;
    min-width: 120px;
}

.feed-hint {
    text-align: center;
    font-size: 13px;
    color: #757575;
    padding: 8px;
    background: linear-gradient(135deg, #E3F2FD, #E0F2F1);
    border-radius: 10px;
    margin-top: 5px;
}

/* Welcome back message styling */
#welcome-back-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: opacity 0.3s ease;
}

#welcome-back-message a {
    font-weight: 500;
    transition: color 0.2s ease;
}

#welcome-back-message a:hover {
    color: #004499 !important;
}

/* Fish highlighting styles for user ownership */
.fish-card.user-fish-highlight {
    background: linear-gradient(135deg, #fff9e6, #fff3d0) !important;
    border: 2px solid #ffd700 !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3) !important;
    transform: scale(1.02) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

.fish-card.user-fish-highlight:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4) !important;
}

/* Add a subtle "Your Fish" indicator without emojis */
.fish-card.user-fish-highlight::before {
    content: 'Your Fish';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 215, 0, 0.9);
    color: #333;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Test class to verify CSS is working */
.test-highlight {
    background: red !important;
    border: 5px solid blue !important;
}

/* ===== 工具栏样式优化 ===== */
#paint-bar {
    max-width: 800px !important;
    margin: 20px auto !important;
    padding: 20px !important;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
    overflow: visible !important;
    box-sizing: border-box;
    border: 2px solid #C7D2FE;
}

#paint-bar > div {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* 工具栏按钮 */
#paint-bar button {
    padding: 10px 20px;
    border: 2px solid #E0E0E0;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6366F1;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#paint-bar button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
    border-color: #6366F1;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
}

#paint-bar button:active {
    transform: translateY(-1px) scale(0.98);
}

/* 颜色按钮容器 */
#paint-bar > div:first-child {
    background: #F5F9FA;
    padding: 12px;
    border-radius: 15px;
}

/* 滑块容器 */
#paint-bar input[type="range"] {
    width: 120px;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #C7D2FE, #6366F1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#paint-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    border: 2px solid white;
    transition: all 0.3s ease;
}

#paint-bar input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

#paint-bar input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    border: 2px solid white;
    transition: all 0.3s ease;
}

#paint-bar input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

/* ===== 鱼概率显示优化 ===== */
#fish-probability {
    display: inline-block;
    padding: 12px 24px;
    margin: 8px 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 3px solid;
    animation: fadeInUp 0.5s ease;
}

#fish-probability.high-probability {
    border-color: #A5D6A7;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
}

#fish-probability.low-probability {
    border-color: #FF6B9D;
    background: linear-gradient(135deg, #FFE5EC, #FFCDD2);
    color: #C62828;
}

/* ===== AI模型加载状态 ===== */
.model-loading-container {
    margin: 5px auto;
    padding: 8px 12px;
    max-width: 450px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ebff 100%);
    border: 2px solid #C7D2FE;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
    animation: fadeInScale 0.3s ease;
}

.model-loading-content {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.loading-fish-icon {
    font-size: 1.2em;
    animation: swim 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes swim {
    0%, 100% {
        transform: translateX(-10px) rotate(-5deg);
    }
    50% {
        transform: translateX(10px) rotate(5deg);
    }
}

.loading-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #4F46E5;
    white-space: nowrap;
    flex-shrink: 0;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366F1 0%, #A5B4FC 50%, #6366F1 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: shimmer 2s linear infinite;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-percentage {
    font-size: 0.85em;
    font-weight: 700;
    color: #6366F1;
    white-space: nowrap;
    flex-shrink: 0;
}

.loading-tip {
    display: none; /* 隐藏提示文字以节省空间 */
}

/* 加载完成状态 */
.model-loading-container.loaded {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-color: #81C784;
}

.model-loading-container.loaded .loading-text {
    color: #2E7D32;
}

.model-loading-container.loaded .loading-fish-icon {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 加载失败状态 */
.model-loading-container.error {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    border-color: #E57373;
}

.model-loading-container.error .loading-text {
    color: #C62828;
}

/* 按钮禁用状态 */
.cute-button:disabled,
.cute-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    animation: none !important;
}

.cute-button:disabled:hover,
.cute-submit-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
}

/* ===== 响应式设计 ===== */

/* 平板和手机端 */
@media (max-width: 768px) {
    /* 画鱼页 */
    #drawing-section h1 {
        font-size: 2em;
        margin: 12px 0 8px;
    }
    
    #drawing-section h2 {
        font-size: 1em;
        margin: 0 0 15px;
    }
    
    .cute-canvas-container {
        padding: 8px;
        margin: 5px auto;
    }
    
    .submit-button-container {
        margin: 5px 0 8px;
    }
    
    #paint-bar {
        padding: 15px !important;
        margin: 15px auto !important;
        max-width: 95% !important;
    }
    
    .nav-links-section {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links-section a,
    .nav-links-section button {
        width: auto;
        padding: 8px 12px !important;
        font-size: 0.85em !important;
        min-width: auto;
        flex: 0 0 auto;
    }
    
    /* 鱼缸页 */
    .tank-wrapper {
        height: calc(100vh - 220px);
    }
    
    .cute-controls-container {
        padding: 12px;
    }
    
    .control-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .control-group .cute-button {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .fish-count-control {
        flex-direction: column;
        gap: 8px;
    }
    
    .cute-slider {
        width: 100%;
        max-width: 300px;
    }
    
    .feed-hint {
        font-size: 11px;
    }
    
    /* 水草在移动端缩小 */
    .seaweed {
        width: 40px;
        height: 150px;
    }
    
    .seaweed-left {
        left: 20px;
    }
    
    .seaweed-right {
        right: 20px;
    }
}

/* 小手机端 */
@media (max-width: 480px) {
    #drawing-section h1 {
        font-size: 1.5em;
        margin: 10px 0 6px;
    }
    
    #drawing-section h2 {
        font-size: 0.9em;
        margin: 0 0 12px;
    }
    
    .cute-canvas-container {
        padding: 6px;
        margin: 3px auto;
    }
    
    .submit-button-container {
        margin: 3px 0 6px;
    }
    
    #draw-canvas {
        max-width: 100%;
        width: 100% !important;
        height: auto !important;
    }
    
    #paint-bar {
        padding: 10px !important;
        margin: 10px auto !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    #paint-bar > div {
        width: 100%;
        justify-content: center !important;
    }
    
    #paint-bar button {
        font-size: 11px !important;
        padding: 6px 12px !important;
    }
    
    .cute-color-button {
        width: 32px !important;
        height: 32px !important;
    }
    
    .cute-submit-btn {
        font-size: 1.1em !important;
        padding: 14px 30px !important;
    }
    
    #fish-probability {
        font-size: 0.95em;
        padding: 10px 20px;
    }
    
    /* 鱼缸页 */
    .tank-wrapper {
        height: calc(100vh - 250px);
    }
    
    .cute-controls-container {
        padding: 10px;
    }
    
    .control-label {
        font-size: 12px;
    }
    
    .control-group {
        flex-direction: column;
        width: 100%;
    }
    
    .control-group .cute-button {
        width: 100%;
        max-width: 250px;
    }
    
    .cute-select {
        width: 100%;
        max-width: 250px;
    }
    
    .decoration {
        width: 30px;
        height: 30px;
    }
    
    .rock {
        width: 40px;
        height: 35px;
    }
}
