/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    background: #000;
    overflow: auto;
    min-height: 100vh;
    cursor: default;
}

/* Animated starfield background */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 0;
    overflow: hidden;
}

.starfield::before,
.starfield::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    background-repeat: repeat;
    transform-origin: 50% 50%;
}

.starfield::before {
    background-image: 
        radial-gradient(circle at 15px 20px, white 1px, transparent 1px),
        radial-gradient(circle at 45px 8px, white 1px, transparent 1px),
        radial-gradient(circle at 25px 35px, white 1px, transparent 1px),
        radial-gradient(circle at 5px 15px, white 1px, transparent 1px),
        radial-gradient(circle at 35px 25px, white 1px, transparent 1px),
        radial-gradient(circle at 55px 45px, white 1px, transparent 1px);
    background-size: 60px 50px, 80px 60px, 100px 80px, 120px 100px, 140px 120px, 160px 140px;
    animation: starsMove1 15s infinite linear;
}

.starfield::after {
    background-image: 
        radial-gradient(circle at 30px 15px, white 1px, transparent 1px),
        radial-gradient(circle at 10px 40px, white 1px, transparent 1px),
        radial-gradient(circle at 50px 25px, white 1px, transparent 1px),
        radial-gradient(circle at 20px 50px, white 1px, transparent 1px),
        radial-gradient(circle at 40px 10px, white 1px, transparent 1px),
        radial-gradient(circle at 60px 35px, white 1px, transparent 1px),
        radial-gradient(circle at 5px 30px, white 1px, transparent 1px),
        radial-gradient(circle at 45px 55px, white 1px, transparent 1px);
    background-size: 70px 60px, 90px 70px, 110px 90px, 130px 110px, 150px 130px, 170px 150px, 190px 170px, 210px 190px;
    animation: starsMove2 20s infinite linear;
}

@keyframes starsMove1 {
    from {
        background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    }
    to {
        background-position: 60px 50px, 80px 60px, 100px 80px, 120px 100px, 140px 120px, 160px 140px;
    }
}

@keyframes starsMove2 {
    from {
        background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    }
    to {
        background-position: -70px -60px, -90px -70px, -110px -90px, -130px -110px, -150px -130px, -170px -150px, -190px -170px, -210px -190px;
    }
}

/* Desktop container */
.desktop {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    padding: 20px;
    z-index: 1;
}

/* Windows 2000 style window */
.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    min-width: 300px;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
    font-size: 12px;
    resize: both;
    overflow: auto;
}

/* Window positioning */
#welcome-window {
    top: 5vh;
    left: 5vw;
    width: 40vw;
    min-width: 320px;
    z-index: 4;
}

#about-window {
    top: 5vh;
    right: 5vw;
    width: 40vw;
    min-width: 280px;
    z-index: 3;
}

#links-window {
    bottom: 15vh;
    left: 5vw;
    width: 40vw;
    min-width: 250px;
    z-index: 2;
}

#gallery-window {
    bottom: 15vh;
    right: 5vw;
    width: 40vw;
    min-width: 300px;
    z-index: 1;
}

/* Title bar */
.title-bar {
    background: linear-gradient(90deg, #0a246a 0%, #a6caf0 4%, #a6caf0 96%, #0a246a 100%);
    color: white;
    padding: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 20px;
    border-bottom: 1px solid #808080;
    cursor: move;
}

.title-bar-text {
    font-weight: bold;
    font-size: 11px;
    padding-left: 4px;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.5);
}

.title-bar-controls {
    display: flex;
    gap: 2px;
    padding-right: 2px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-bar-controls button:hover {
    background: #e0e0e0;
}

.title-bar-controls button:active {
    border: 1px inset #c0c0c0;
    background: #a0a0a0;
}

.close-btn {
    color: #000;
}

/* Window content */
.window-content {
    padding: 8px;
    background: #c0c0c0;
    color: #000;
    min-height: 100px;
}

/* Typography and retro elements */
h1 {
    font-family: 'Comic Sans MS', cursive;
    font-size: 18px;
    color: #0000ff;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #800080;
    margin-bottom: 8px;
    text-decoration: underline;
}

p {
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Blinking text effect */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

blink {
    animation: blink 1s infinite;
    color: #ff0000;
    font-weight: bold;
}

/* Marquee styling */
marquee {
    background: #ffff00;
    color: #ff0000;
    font-weight: bold;
    padding: 2px 5px;
    border: 1px solid #000;
    margin: 5px 0;
}

/* Visitor counter */
.counter {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 2px 4px;
    border: 1px inset #c0c0c0;
    font-weight: bold;
}

/* Links styling */
a {
    color: #0000ee;
    text-decoration: underline;
}

a:visited {
    color: #551a8b;
}

a:hover {
    color: #ff0000;
    background: #ffff00;
    text-decoration: none;
}

.links-container {
    background: #fff;
    border: 2px inset #c0c0c0;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.links-container p {
    padding: 2px;
    border-bottom: 1px dotted #ccc;
}

/* Image gallery */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: #fff;
    border: 2px inset #c0c0c0;
    padding: 8px;
}

.image-item {
    border: 1px solid #808080;
    background: #f0f0f0;
    padding: 4px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.image-item:hover {
    background: #e0e0e0;
}

.image-item img {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    border: 1px inset #c0c0c0;
    margin-bottom: 4px;
}

.image-caption p {
    margin: 1px 0;
    font-size: 10px;
    color: #000;
}

.image-caption p:first-child {
    font-weight: bold;
    color: #000080;
}

/* Font styling */
font[color] {
    font-weight: bold;
}

/* Scrollbar styling for retro look */
::-webkit-scrollbar {
    width: 16px;
}

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

::-webkit-scrollbar-thumb {
    background: #808080;
    border: 2px outset #c0c0c0;
}

::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

/* Additional retro styling */
.window:focus-within {
    z-index: 100;
}

.window:focus-within .title-bar {
    background: linear-gradient(90deg, #0a246a 0%, #a6caf0 4%, #a6caf0 96%, #0a246a 100%);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #welcome-window {
        width: 45vw;
        min-width: 300px;
    }
    
    #about-window {
        width: 45vw;
        min-width: 280px;
    }
    
    #links-window {
        width: 45vw;
        min-width: 250px;
    }
    
    #gallery-window {
        width: 45vw;
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .window {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 95vw !important;
        min-width: 280px !important;
        margin: 0 auto 20px auto;
        max-width: none;
    }
    
    .desktop {
        padding: 10px;
        overflow-y: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
}