/* 小王子風格配色 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5d76e;
    --accent-color: #e27d60;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #eaeaea;
    --text-secondary: #a8a8a8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow:
        100px 200px white, 300px 100px white, 500px 300px white,
        700px 150px white, 200px 400px white, 600px 250px white,
        150px 50px white, 450px 400px white, 800px 350px white,
        250px 150px white, 550px 50px white, 350px 350px white,
        100px 500px white, 400px 200px white, 650px 450px white,
        50px 300px white, 750px 100px white, 900px 250px white;
    animation: twinkle 3s infinite;
}

.stars::after {
    animation-delay: 1.5s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header 樣式 */
header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(245, 215, 110, 0.1));
    border-radius: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.little-prince {
    margin-bottom: 20px;
}

.prince-character {
    width: 150px;
    height: auto;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    object-fit: contain;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

/* Search container */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    font-family: 'Arial', sans-serif;
    background: var(--card-bg);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 25px;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#search-input::placeholder {
    color: var(--text-secondary);
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
}

#search-results {
    margin-top: 10px;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-family: 'Arial', sans-serif;
    min-height: 20px;
}

/* Filters container */
.filters-container {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: 'Arial', sans-serif;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: 'Arial', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

/* 範例卡片樣式 */
#samples-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 60px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.sample-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.sample-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.4);
    border-color: var(--primary-color);
}

.platform-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    height: 48px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sample-card:hover .platform-badge {
    opacity: 1;
    transform: scale(1.1);
}

.sample-card h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    line-height: 1.4;
    padding-right: 70px;
    height: 4.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.tech-tag {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: 'Arial', sans-serif;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Arial', sans-serif;
}

.link-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.link-btn::before {
    margin-right: 8px;
}

.link-btn.code::before {
    content: '💻';
}

.link-btn.video::before {
    content: '🎥';
}

.link-btn.documentation::before {
    content: '📖';
}

.link-btn.book::before {
    content: '📚';
}

/* Specials 樣式 */
.specials-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(245, 215, 110, 0.1);
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

.specials-title {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.specials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.special-item {
    display: flex;
    align-items: center;
}

.special-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 28px;
}

.special-link::before {
    content: '🔗';
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.special-link:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.special-link:hover::before {
    transform: scale(1.2);
}

.special-text {
    color: var(--text-color);
    font-size: 0.95rem;
    padding-left: 28px;
    position: relative;
}

.special-text::before {
    content: '⭐';
    position: absolute;
    left: 0;
}

/* 截圖畫廊樣式 */
.screenshot-gallery {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-bg);
}

.screenshot-gallery::-webkit-scrollbar {
    height: 8px;
}

.screenshot-gallery::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

.screenshot-gallery::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.screenshot-item {
    flex-shrink: 0;
    width: calc((100% - 20px) / 3);
    max-width: 120px;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(74, 144, 226, 0.3);
}

.screenshot-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.5);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 圖片燈箱樣式 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

.lightbox-title {
    text-align: center;
    color: white;
    margin-top: 15px;
    font-size: 1.1rem;
}


/* Footer 樣式 */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.planet {
    font-size: 60px;
    margin-bottom: 15px;
    display: inline-block;
    animation: rotate 20s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

footer p {
    font-size: 1.1rem;
    font-style: italic;
}

/* 響應式設計 */
@media (max-width: 1200px) {
    #samples-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .filters-container {
        padding: 0 10px;
    }

    .filter-label {
        font-size: 0.9rem;
    }

    .filter-btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }

    #samples-container {
        grid-template-columns: 1fr;
    }

    .sample-card {
        padding: 20px;
    }

    .screenshot-item {
        width: calc((100% - 20px) / 3);
        max-width: 90px;
        aspect-ratio: 9 / 16;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-close {
        top: -35px;
        font-size: 35px;
    }
}