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

body {
    background: #000000;
    overflow-x: hidden;
    font-family: 'Arial', sans-serif;
    color: white;
}

.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: -1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.comet {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8),
                0 0 20px 4px rgba(168, 218, 220, 0.6),
                0 0 30px 6px rgba(74, 144, 226, 0.4);
    opacity: 0;
    z-index: 5;
}

.comet::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(168, 218, 220, 0.6) 40%,
        rgba(74, 144, 226, 0.3) 70%,
        transparent 100%);
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
}

@keyframes cometFly {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(-45deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-1500px, 1500px) rotate(-45deg);
    }
}

.astronaut {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 12s ease-in-out infinite;
    cursor: grab;
    user-select: none;
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -60%) rotate(5deg);
    }
}

.astronaut img {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0.3));
    pointer-events: none;
}

.astronaut-1 {
    top: 50%;
    left: 50%;
    animation-delay: 0s;
}

.astronaut-2 {
    top: 25%;
    left: 20%;
    animation-delay: 2s;
}

.astronaut-2 img {
    width: 180px;
}

.astronaut-3 {
    top: 70%;
    left: 75%;
    animation-delay: 4s;
}

.astronaut-3 img {
    width: 220px;
}

.astronaut-4 {
    top: 35%;
    right: 15%;
    animation-delay: 6s;
}

.astronaut-4 img {
    width: 160px;
}

.astronaut-5 {
    bottom: 20%;
    left: 30%;
    animation-delay: 8s;
}

.astronaut-5 img {
    width: 200px;
}

.keyboard-controls {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.keyboard-controls h3 {
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.keys-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.key-row {
    display: flex;
    gap: 5px;
}

.key {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    transition: all 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.key.active {
    background: rgba(74, 144, 226, 0.8);
    border-color: rgba(74, 144, 226, 1);
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 
                0 0 20px rgba(74, 144, 226, 0.6),
                inset 0 0 10px rgba(255, 255, 255, 0.3);
    color: #fff;
}

.speed-control {
    position: fixed;
    top: 180px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.speed-control h3 {
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
    color: #fff;
}

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

.slider {
    width: 200px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.speed-label {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.name-title {
    position: fixed;
    top: 130px;
    left: 120%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-family: 'Georgia', serif;
    font-weight: 10;
    background: linear-gradient(135deg, #ffffff 0%, #e0f7ff 25%, #a8dadc 50%, #457b9d 75%, #1d3557 100%);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite, float 16s ease-in-out infinite;
    letter-spacing: 0.05em;
    z-index: 50;
    filter: drop-shadow(0 0 40px rgba(168, 218, 220, 0.8)) 
            drop-shadow(0 0 80px rgba(74, 144, 226, 0.4))
            drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
    text-transform: uppercase;
    position: relative;
}

.name-title::before {
    content: 'Saif Zaidan';
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(168, 218, 220, 0.3), rgba(74, 144, 226, 0.3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(20px);
    animation: gradientShift 10s ease infinite;
}

.jordan-clock {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    text-align: center;
}

.clock-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.clock-time {
    font-size: 32px;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
}

.clock-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.life-counter {
    position: fixed;
    top: 160px;
    left: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    text-align: center;
    min-width: 180px;
}

.counter-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.counter-number {
    font-size: 36px;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(168, 218, 220, 0.5);
    margin-bottom: 8px;
    background: linear-gradient(45deg, #ffffff, #a8dadc, #457b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.counter-detail {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.quote-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.quote-header {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.quote-content {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

.quote-content a {
    color: rgba(168, 218, 220, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.quote-content a:hover {
    color: rgba(168, 218, 220, 1);
    text-decoration: underline;
}

/* Hide the "Visit quotation page" footer text */
.quote-content > p:last-child,
.quote-content > font:last-child,
.quote-content dl + *,
.quote-content .tqpFooter {
    display: none !important;
}

.ai-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-height: 500px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ai-chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    letter-spacing: 1px;
}

.toggle-chat {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.toggle-chat:hover {
    transform: scale(1.2);
}

.ai-chat-content {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.ai-chat-content.collapsed {
    display: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.user-message, .ai-message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease;
}

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

.user-message {
    background: rgba(74, 144, 226, 0.3);
    border: 1px solid rgba(74, 144, 226, 0.5);
    align-self: flex-end;
    color: #fff;
}

.ai-message {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-self: flex-start;
    color: #fff;
}

.ai-message.loading {
    opacity: 0.6;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#chatInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#chatInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#chatInput:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(74, 144, 226, 0.5);
}

#sendBtn {
    background: rgba(74, 144, 226, 0.3);
    border: 1px solid rgba(74, 144, 226, 0.5);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#sendBtn:hover {
    background: rgba(74, 144, 226, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.planets-container {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.planet {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.planet:hover {
    transform: scale(1.25);
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.6)) brightness(1.3);
    animation-play-state: paused;
}

.planet:hover .planet-inner {
    animation-play-state: paused;
}

.planet::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 1), 
                 0 0 15px rgba(255, 255, 255, 0.8),
                 0 4px 8px rgba(0, 0, 0, 0.8);
    opacity: 1;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.planet:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
    text-shadow: 0 2px 25px rgba(0, 0, 0, 1), 
                 0 0 25px rgba(255, 255, 255, 1),
                 0 6px 12px rgba(0, 0, 0, 0.9);
}

.planet-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.planet-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.planet-1 {
    top: 50%;
    left: 50%;
    animation: orbit1 25s linear infinite;
}

.planet-1 .planet-inner {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(139, 90, 60, 0.9) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 70%, rgba(92, 61, 46, 0.8) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 50%, rgba(61, 40, 23, 0.7) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 20%, rgba(107, 73, 48, 0.6) 0%, transparent 35%),
        linear-gradient(135deg, #8b5a3c 0%, #5c3d2e 50%, #3d2817 100%);
    background-size: 100% 100%, 80% 80%, 120% 120%, 90% 90%, 100% 100%;
    box-shadow: inset -20px -20px 50px rgba(0, 0, 0, 0.8), 
                inset 10px 10px 30px rgba(139, 90, 60, 0.2),
                0 0 25px rgba(139, 90, 60, 0.4);
    animation: rotatePlanet 30s linear infinite;
}

.planet-2 {
    top: 50%;
    left: 50%;
    animation: orbit2 25s linear infinite;
}

.planet-2 .planet-inner {
    background: 
        radial-gradient(circle at 25% 25%, rgba(74, 95, 127, 0.9) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(44, 62, 86, 0.8) 0%, transparent 35%),
        radial-gradient(circle at 50% 80%, rgba(26, 35, 50, 0.9) 0%, transparent 40%),
        repeating-linear-gradient(45deg, #4a5f7f 0px, #2c3e56 20px, #1a2332 40px),
        linear-gradient(180deg, #4a5f7f 0%, #2c3e56 50%, #1a2332 100%);
    background-size: 100% 100%, 90% 90%, 110% 110%, 60px 60px, 100% 100%;
    box-shadow: inset -20px -20px 50px rgba(0, 0, 0, 0.8),
                inset 10px 10px 30px rgba(74, 95, 127, 0.3),
                0 0 25px rgba(74, 95, 127, 0.4);
    animation: rotatePlanet 25s linear infinite;
}

.planet-3 {
    top: 50%;
    left: 50%;
    animation: orbit3 25s linear infinite;
}

.planet-3 .planet-inner {
    background: 
        radial-gradient(ellipse at 30% 40%, rgba(107, 127, 94, 0.8) 0%, transparent 35%),
        radial-gradient(ellipse at 65% 25%, rgba(74, 87, 66, 0.9) 0%, transparent 40%),
        radial-gradient(ellipse at 45% 75%, rgba(46, 52, 40, 0.8) 0%, transparent 38%),
        radial-gradient(ellipse at 85% 55%, rgba(90, 105, 80, 0.7) 0%, transparent 32%),
        radial-gradient(ellipse at 15% 80%, rgba(60, 70, 55, 0.8) 0%, transparent 36%),
        linear-gradient(90deg, #6b7f5e 0%, #4a5742 50%, #2e3428 100%);
    background-size: 90% 90%, 100% 100%, 110% 110%, 80% 80%, 95% 95%, 100% 100%;
    box-shadow: inset -20px -20px 50px rgba(0, 0, 0, 0.8),
                inset 10px 10px 30px rgba(107, 127, 94, 0.2),
                0 0 25px rgba(107, 127, 94, 0.4);
    animation: rotatePlanet 35s linear infinite;
}

.planet-4 {
    top: 50%;
    left: 50%;
    animation: orbit4 25s linear infinite;
}

.planet-4 .planet-inner {
    background: 
        radial-gradient(circle at 35% 35%, rgba(122, 92, 111, 0.9) 0%, transparent 40%),
        radial-gradient(circle at 65% 70%, rgba(84, 61, 78, 0.8) 0%, transparent 35%),
        radial-gradient(circle at 20% 65%, rgba(54, 36, 50, 0.9) 0%, transparent 38%),
        repeating-radial-gradient(circle at 50% 50%, rgba(122, 92, 111, 0.3) 0%, transparent 15px, rgba(84, 61, 78, 0.4) 30px),
        linear-gradient(160deg, #7a5c6f 0%, #543d4e 50%, #362432 100%);
    background-size: 100% 100%, 95% 95%, 105% 105%, 50px 50px, 100% 100%;
    box-shadow: inset -20px -20px 50px rgba(0, 0, 0, 0.8),
                inset 10px 10px 30px rgba(122, 92, 111, 0.3),
                0 0 25px rgba(122, 92, 111, 0.4);
    animation: rotatePlanet 40s linear infinite;
}

@keyframes rotatePlanet {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes orbit1 {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg) translateX(300px) rotate(0deg);
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg) translateX(300px) rotate(-360deg);
    }
}

@keyframes orbit2 {
    0% { 
        transform: translate(-50%, -50%) rotate(90deg) translateX(300px) rotate(-90deg);
    }
    100% { 
        transform: translate(-50%, -50%) rotate(450deg) translateX(300px) rotate(-450deg);
    }
}

@keyframes orbit3 {
    0% { 
        transform: translate(-50%, -50%) rotate(180deg) translateX(300px) rotate(-180deg);
    }
    100% { 
        transform: translate(-50%, -50%) rotate(540deg) translateX(300px) rotate(-540deg);
    }
}

@keyframes orbit4 {
    0% { 
        transform: translate(-50%, -50%) rotate(270deg) translateX(300px) rotate(-270deg);
    }
    100% { 
        transform: translate(-50%, -50%) rotate(630deg) translateX(300px) rotate(-630deg);
    }
}

@keyframes planetZoomIn {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(5);
        opacity: 0;
    }
}

.planet.zooming {
    animation: planetZoomIn 0.8s ease-in forwards;
    z-index: 1000;
}

.planet.zooming .planet-inner {
    animation: none;
}

.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    transform-origin: center center;
}

.zoom-overlay.active {
    animation: pageZoomIn 1s ease-in forwards;
}

@keyframes pageZoomIn {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(15);
        opacity: 0;
    }
}

body.zooming {
    overflow: hidden;
}

body.zooming > *:not(.zoom-overlay) {
    animation: contentZoom 1s ease-in forwards;
}

@keyframes contentZoom {
    0% {
        transform: scale(1);
        filter: blur(0px);
    }
    100% {
        transform: scale(15);
        filter: blur(10px);
    }
}
