/* World Wide Wood - Main Styles */

/* Tasteful global typography & spacing */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    line-height: 1.7;
    letter-spacing: 0.001em;
}

h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -0.01em;
}

p {
    max-width: 65ch;
}

a {
    text-underline-offset: 3px;
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Link card hover effects */
.link-card {
    transition: all 0.2s ease;
}

.link-card:hover {
    transform: translateY(-2px);
}

/* Video container for full-screen background */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    transform: translate(-50%, -50%);
}

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

/* Fullscreen background image + animated gradient overlay */
.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: url('/bg.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 100%);
    background-size: 200% 200%;
    animation: gradientDrift 120s linear infinite alternate;
}

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

/* Avatar upload preview */
.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* File upload button styling */
.file-upload-button {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-button input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: inline-block;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.file-upload-label:hover {
    border-color: #16a34a;
    background-color: #f0fdf4;
}

/* Theme selector improvements */
.theme-option {
    cursor: pointer;
    transition: all 0.2s;
}

.theme-option:hover {
    transform: scale(1.05);
}

/* Field error highlighting */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-container {
        display: none; /* Hide video on mobile for performance */
    }
    
    /* Fix username input overflow on mobile */
    input[type="text"], input[type="email"], input[type="password"] {
        min-width: 0;
        max-width: 100%;
    }
    
    /* Ensure flex containers don't cause overflow */
    .flex {
        flex-wrap: nowrap;
    }
    
    /* Make username prefix not wrap */
    .whitespace-nowrap {
        flex-shrink: 0;
    }
}