/* Vibe Coding Club 主要样式文件 */

:root {
    --primary-color: #0891b2;
    --secondary-color: #0d9488;
    --accent-color: #3730a3;
    --text-color: #1f2937;
    --light-text: #f9fafb;
    --bg-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* 全局樣式 */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scroll-behavior: smooth;
    color: var(--text-color);
    position: relative;
}

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

/* 背景光斑限制在視窗內，避免撐出橫向捲軸 */
.page-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* 語言切換 */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-switcher a {
    color: #6b7280;
    text-decoration: none;
    padding: 0.125rem 0.05rem;
    transition: color 0.2s ease;
}

.lang-switcher a:hover,
.lang-switcher a.is-active {
    color: var(--primary-color);
}

.lang-switcher a.is-active {
    font-weight: 700;
}

.lang-switcher .lang-sep {
    color: #d1d5db;
    user-select: none;
}

@media (max-width: 380px) {
    .lang-switcher {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
}

/* 文字漸變效果 */
.text-gradient {
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    max-width: 100%;
}

h1 .text-gradient,
h2 .text-gradient {
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

header .text-gradient {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

/* 背景漸變效果 */
.bg-gradient {
    background: var(--bg-gradient);
}

/* 導航鏈接樣式 */
.nav-link {
    position: relative;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--bg-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* 按鈕樣式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: 0 4px 6px rgba(8, 145, 178, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(8, 145, 178, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(8, 145, 178, 0.1);
}

/* 卡片樣式 */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

/* 特效元素 */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.2;
    z-index: -1;
}

/* 動畫效果 */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

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

.slide-in {
    animation: slideIn 1s ease-in-out;
}

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

.slow-spin {
    animation: slowSpin 15s linear infinite;
}

@keyframes slowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 自定義滾動條 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 移動菜單 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(20rem, 86vw);
    height: 100%;
    height: 100dvh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 50;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.mobile-menu .nav-link {
    display: block;
    padding: 0.65rem 0;
    font-size: 1.05rem;
}

.mobile-menu .lang-switcher {
    display: flex;
}

#menu-toggle,
#close-menu {
    min-width: 2.75rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
}

.mobile-menu.open {
    right: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 40;
}

.menu-overlay.open {
    display: block;
}

/* 返回頂部按鈕 */
#back-to-top {
    position: fixed;
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
    background-color: var(--primary-color);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#back-to-top:hover {
    background-color: var(--secondary-color);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.container {
    width: 100%;
}

/* 響應式樣式 */
@media (max-width: 1023px) {
    header .lang-switcher {
        display: none;
    }
}

@media (max-width: 767px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 {
        font-size: 1.75rem !important;
        line-height: 1.25;
        word-break: break-word;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
        word-break: break-word;
    }

    .btn {
        padding: 0.65rem 1.1rem;
        min-height: 2.75rem;
    }

    section.py-20 {
        padding-top: 3.25rem;
        padding-bottom: 3.25rem;
    }

    section.pt-20,
    section.pt-24 {
        padding-top: 3.5rem;
    }

    section.pb-32 {
        padding-bottom: 4.5rem;
    }

    header .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    main .p-8,
    main .md\:p-12 {
        padding: 1.25rem;
    }

    #home .grid.grid-cols-3 {
        gap: 0.5rem;
    }

    #home .grid.grid-cols-3 .text-3xl {
        font-size: 1.5rem;
    }

    #home .grid.grid-cols-3 .text-sm {
        font-size: 0.75rem;
    }

    #home .absolute.-left-4 {
        left: 0.5rem;
        bottom: 0.5rem;
    }

    .card .flex.items-center.text-sm {
        flex-wrap: wrap;
        row-gap: 0.25rem;
        column-gap: 0.75rem;
    }

    main p,
    footer p {
        overflow-wrap: break-word;
    }

    #activities .grid > div.border-r {
        border-right-width: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    #activities .grid > div:last-child {
        border-bottom-width: 0;
    }

    footer .flex.space-x-6 {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 1.25rem;
    }

    footer .flex.space-x-6 > * {
        margin: 0;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .overflow-x-auto table {
        min-width: 36rem;
    }

    #activities .rounded-xl .p-8 {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 479px) {
    header a span.text-gradient {
        display: inline-block;
        font-size: 0.95rem;
    }

    #home .flex.flex-wrap.gap-4 > .btn {
        width: 100%;
    }

    #join .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .lang-switcher {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Tabs Component */
.tabs-container {
    width: 100%;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab:hover {
    color: #0891b2;
}

.tab.active {
    color: #0891b2;
    border-bottom-color: #0891b2;
}

.tab-content {
    display: none;
    padding: 1rem 0;
}

.tab-content.active {
    display: block;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: auto;
    min-width: 120px;
    max-width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Top tooltip */
.tooltip-top .tooltip-text {
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-top .tooltip-text::after {
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-color: #333 transparent transparent transparent;
}

/* Right tooltip */
.tooltip-right .tooltip-text {
    top: 50%;
    left: 125%;
    transform: translateY(-50%);
    bottom: auto;
}

.tooltip-right .tooltip-text::after {
    top: 50%;
    left: -5px;
    margin-top: -5px;
    border-color: transparent #333 transparent transparent;
}

/* Bottom tooltip */
.tooltip-bottom .tooltip-text {
    top: 125%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-bottom .tooltip-text::after {
    bottom: 100%;
    top: auto;
    left: 50%;
    margin-left: -5px;
    border-color: transparent transparent #333 transparent;
}

/* Left tooltip */
.tooltip-left .tooltip-text {
    top: 50%;
    right: 125%;
    left: auto;
    transform: translateY(-50%);
}

.tooltip-left .tooltip-text::after {
    top: 50%;
    right: -5px;
    left: auto;
    margin-top: -5px;
    border-color: transparent transparent transparent #333;
}

/* Show tooltip on hover */
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Dropdown Menu */
.dropdown, .dropup {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: #343a40;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropup .dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.125rem;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover, .dropdown-item:focus {
    color: #16181b;
    text-decoration: none;
    background-color: #f8f9fa;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid #e9ecef;
}

.dropdown-header {
    display: block;
    padding: 0.5rem 1.5rem;
    margin-bottom: 0;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropup:hover .dropdown-menu,
.dropup:focus-within .dropdown-menu {
    display: block;
}

.dropdown-menu.show {
    display: block;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-in-out;
}

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

.animate-slide-up {
    animation: slideUp 1s ease-in-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-bounce {
    animation: bounce 1s ease infinite;
}

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

.animate-pulse {
    animation: pulse 2s ease infinite;
}

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

.animate-spin {
    animation: spin 4s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-breathing {
    animation: breathing 4s ease infinite;
}

@keyframes breathing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-shake {
    transition: transform 0.3s ease;
}

.hover-shake:hover {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.hover-color-shift {
    transition: background-color 0.3s ease;
}

.hover-color-shift:hover {
    background-color: #0d9488; /* teal-600 */
}

.hover-border-animation {
    overflow: hidden;
}

.hover-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #0891b2, #0d9488);
    transition: width 0.3s ease;
}

.hover-border-animation:hover .hover-border {
    width: 100%;
}

.animate-stagger-1 {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.animate-stagger-2 {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.2s;
}

.animate-stagger-3 {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.4s;
}

.animate-stagger-4 {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.6s;
}

.animate-loading-bar {
    width: 0;
    animation: loadingBar 2.5s ease-in-out infinite;
}

@keyframes loadingBar {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #0891b2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Dark Mode */
:root {
    color-scheme: light;
}

.dark {
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Dark mode base styles */
.dark body {
    background-color: #111827;
    color: #f3f4f6;
}

.dark .bg-white {
    background-color: #1f2937;
}

.dark .text-gray-800, 
.dark .text-gray-900 {
    color: #f3f4f6;
}

.dark .text-gray-600, 
.dark .text-gray-700 {
    color: #d1d5db;
}

.dark .text-gray-500 {
    color: #9ca3af;
}

.dark .border {
    border-color: #374151;
}

.dark .border-gray-200, 
.dark .border-gray-300 {
    border-color: #374151;
}

.dark .shadow-md, 
.dark .shadow-lg, 
.dark .shadow-sm {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark .bg-gray-100 {
    background-color: #1f2937;
}

.dark .bg-gray-200 {
    background-color: #374151;
}

/* Dark mode form elements */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark textarea,
.dark select {
    background-color: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark input[type="password"]:focus,
.dark input[type="number"]:focus,
.dark textarea:focus,
.dark select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.dark input::placeholder {
    color: #9ca3af;
}

/* Dark mode dropdown */
.dark .dropdown-menu {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dark .dropdown-item {
    color: #e5e7eb;
}

.dark .dropdown-item:hover, 
.dark .dropdown-item:focus {
    color: #fff;
    background-color: #374151;
}

.dark .dropdown-divider {
    border-top-color: #374151;
}

.dark .dropdown-header {
    color: #9ca3af;
}

/* Dark mode tooltip */
.dark .tooltip-text {
    background-color: #111827;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dark .tooltip-text::after {
    border-color: #111827 transparent transparent transparent;
}

.dark .tooltip-bottom .tooltip-text::after {
    border-color: transparent transparent #111827 transparent;
}

.dark .tooltip-left .tooltip-text::after {
    border-color: transparent transparent transparent #111827;
}

.dark .tooltip-right .tooltip-text::after {
    border-color: transparent #111827 transparent transparent;
}

/* Dark mode code blocks */
.dark .code-block {
    background-color: #111827;
}

/* Media Queries */
@media (max-width: 640px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1 0 auto;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem;
    }
} 