/**
 * @file    : css/logo-3d.css
 * @purpose : 3D Saturn Logo - 土星樣式 AI 智能核心
 * @depends : ['css/variables.css']
 * @design  : 球體 + 星環 + 盤旋衛星 + 漸層色澤
 */

/* ========================================
   土星場景容器
   ======================================== */
.saturn-scene {
    width: 56px;
    height: 56px;
    position: relative;
    /* 增加右邊距，離文字遠一點 */
    margin-right: 16px;
    flex-shrink: 0;
}

.saturn-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    /* 整體微傾斜，更有立體感 */
    transform: rotateX(-15deg) rotateZ(-10deg);
    animation: saturn-float 4s ease-in-out infinite;
}

/* ========================================
   土星本體 (球體)
   ======================================== */
.saturn-planet {
    position: absolute;
    width: 36px;
    height: 36px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    /* 漸層模擬球體光照 - 暖橘色系 */
    background:
        radial-gradient(ellipse 60% 40% at 30% 25%, rgba(255, 255, 255, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 40% 40%, #FFB347 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, #F5A623 0%, #E67E22 40%, #D35400 70%, #8B3A00 100%);
    /* 多層陰影創造立體感 */
    box-shadow:
        inset -8px -8px 20px rgba(0, 0, 0, 0.4),
        inset 4px 4px 15px rgba(255, 200, 100, 0.3),
        0 0 20px rgba(245, 166, 35, 0.5),
        0 0 40px rgba(230, 126, 34, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* 內部發光核心 */
.saturn-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 215, 0, 0.4) 0%, transparent 50%);
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ========================================
   土星環
   ======================================== */
.saturn-ring {
    position: absolute;
    width: 70px;
    height: 70px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg);
    border-radius: 50%;
    /* 環的漸層 - 金橘色透明 */
    background: transparent;
    border: 4px solid transparent;
    border-image: linear-gradient(90deg,
            rgba(255, 179, 71, 0.1) 0%,
            rgba(245, 166, 35, 0.6) 25%,
            rgba(255, 215, 0, 0.8) 50%,
            rgba(245, 166, 35, 0.6) 75%,
            rgba(255, 179, 71, 0.1) 100%) 1;
    /* 使用偽元素創建更好的環效果 */
    z-index: 1;
}

/* 使用偽元素創建更逼真的土星環 */
.saturn-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    /* 主環 - 漸層金橘色 */
    border: 6px solid transparent;
    background:
        linear-gradient(90deg,
            rgba(255, 179, 71, 0.05) 0%,
            rgba(245, 166, 35, 0.4) 20%,
            rgba(255, 215, 0, 0.6) 40%,
            rgba(230, 126, 34, 0.7) 60%,
            rgba(245, 166, 35, 0.4) 80%,
            rgba(255, 179, 71, 0.05) 100%) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow:
        0 0 10px rgba(245, 166, 35, 0.3),
        inset 0 0 5px rgba(255, 215, 0, 0.2);
}

/* 外環 */
.saturn-ring::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px solid rgba(245, 166, 35, 0.25);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.2);
}

/* ========================================
   盤旋衛星軌道
   ======================================== */
.saturn-orbit {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: orbit-rotate 6s linear infinite;
    z-index: 10;
}

.saturn-orbit-2 {
    width: 60px;
    height: 60px;
    animation: orbit-rotate 4s linear infinite reverse;
    animation-delay: -1s;
}

/* 衛星 */
.saturn-moon {
    position: absolute;
    width: 6px;
    height: 6px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #FFD700 0%, #F5A623 50%, #E67E22 100%);
    box-shadow:
        0 0 8px rgba(255, 215, 0, 0.8),
        0 0 15px rgba(245, 166, 35, 0.5);
    animation: moon-glow 1.5s ease-in-out infinite;
}

.saturn-moon-2 {
    width: 4px;
    height: 4px;
    background: radial-gradient(circle at 30% 30%, #FFB347 0%, #E67E22 100%);
    box-shadow:
        0 0 6px rgba(255, 179, 71, 0.7),
        0 0 12px rgba(230, 126, 34, 0.4);
    animation-delay: 0.5s;
}

/* ========================================
   動畫 Keyframes
   ======================================== */

/* 土星整體浮動 */
@keyframes saturn-float {

    0%,
    100% {
        transform: rotateX(-15deg) rotateZ(-10deg) translateY(0);
    }

    50% {
        transform: rotateX(-15deg) rotateZ(-10deg) translateY(-3px);
    }
}

/* 衛星軌道旋轉 */
@keyframes orbit-rotate {
    0% {
        transform: translate(-50%, -50%) rotateZ(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(360deg);
    }
}

/* 發光脈動 */
@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* 衛星發光 */
@keyframes moon-glow {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow:
            0 0 8px rgba(255, 215, 0, 0.8),
            0 0 15px rgba(245, 166, 35, 0.5);
    }

    50% {
        transform: translateX(-50%) scale(1.2);
        box-shadow:
            0 0 12px rgba(255, 215, 0, 1),
            0 0 20px rgba(245, 166, 35, 0.7);
    }
}

/* ========================================
   Hover 互動效果
   ======================================== */
.nav-logo:hover .saturn-wrapper {
    animation-play-state: paused;
}

.nav-logo:hover .saturn-orbit {
    animation-play-state: paused;
}

.nav-logo:hover .saturn-planet {
    box-shadow:
        inset -8px -8px 20px rgba(0, 0, 0, 0.4),
        inset 4px 4px 15px rgba(255, 200, 100, 0.4),
        0 0 30px rgba(245, 166, 35, 0.7),
        0 0 50px rgba(230, 126, 34, 0.4),
        0 8px 25px rgba(0, 0, 0, 0.35);
}

/* ========================================
   Scrolled 狀態 - 縮小
   ======================================== */
.navbar-scrolled .saturn-scene {
    width: 44px;
    height: 44px;
    margin-right: 12px;
}

.navbar-scrolled .saturn-planet {
    width: 28px;
    height: 28px;
}

.navbar-scrolled .saturn-ring {
    width: 54px;
    height: 54px;
}

.navbar-scrolled .saturn-orbit {
    width: 62px;
    height: 62px;
}

.navbar-scrolled .saturn-orbit-2 {
    width: 46px;
    height: 46px;
}

.navbar-scrolled .saturn-moon {
    width: 5px;
    height: 5px;
}

.navbar-scrolled .saturn-moon-2 {
    width: 3px;
    height: 3px;
}

/* ========================================
   prefers-reduced-motion 無障礙支援
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    .saturn-wrapper,
    .saturn-orbit,
    .saturn-orbit-2,
    .saturn-glow,
    .saturn-moon {
        animation: none;
    }
}

/* ========================================
   響應式調整
   ======================================== */
@media (max-width: 768px) {
    .saturn-scene {
        width: 44px;
        height: 44px;
        margin-right: 12px;
    }

    .saturn-planet {
        width: 28px;
        height: 28px;
    }

    .saturn-ring {
        width: 54px;
        height: 54px;
    }

    .saturn-orbit {
        width: 62px;
        height: 62px;
    }

    .saturn-orbit-2 {
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 480px) {
    .saturn-scene {
        width: 40px;
        height: 40px;
        margin-right: 8px;
    }

    .saturn-planet {
        width: 24px;
        height: 24px;
    }

    .saturn-ring {
        width: 48px;
        height: 48px;
    }
}