/* Hybrid style.css combining spaceship animation with booking interface */

/* ========================================= */
/* === Spaceship Canvas & Global Layout === */
/* ========================================= */

html {
    /* Responsive base font size using clamp for smooth scaling */
    font-size: clamp(10px, calc(10px + (16 - 10) * (100vw - 320px) / (1200 - 320)), 16px);
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    overflow: hidden; /* Prevent scrollbars as canvas fills viewport */
    background: #000; /* Dark background for space theme */
    color: #eee; /* Light default text color for space theme */
    font-family: Inter, "Inter Fallback", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: auto;
    font-size: 1rem;
    position: relative;
    min-height: 100vh;
    line-height: 1.4;
}

/* Canvas container for spaceship simulation */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind all content */
    pointer-events: none; /* Allow clicks to pass through to content */
}

/* Main content column that acts as obstacles for spaceships */
.main-content-column {
    position: relative;
    z-index: 10;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    min-height: 100vh;
    justify-content: center;
}

/* ========================================= */
/* === Booking Interface Styles ========== */
/* ========================================= */

/* ========================================= */
/* === Obstacle Styling (Matching Homepage) */
/* ========================================= */

/* Base style for draggable DOM elements acting as obstacles */
.obstacle {
    background: rgba(60, 60, 70, 0.85); /* Semi-transparent dark grey background */
    color: #ddd; /* Light grey text for readability */
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid #445; /* Darker border */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    position: absolute; /* Required for JavaScript-controlled positioning */
    width: 20rem; /* Default width, can be overridden by specific obstacle styles or JS */
    max-width: 90vw; /* Prevent obstacles from becoming too wide on small screens */
    height: auto; /* Height adjusts to content */
    cursor: grab; /* Indicates the element is draggable */
    z-index: 2; /* Above canvas and main content column, below p5 UI and dragged items */
    pointer-events: auto; /* Obstacles themselves are interactive (can be clicked/dragged) */
    will-change: transform, opacity, top, left; /* Performance hint for browsers */
    /* Ensure text within obstacles IS selectable by default */
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Class to make the obstacle visible and in its "normal" transformed state */
.obstacle-visible {
    opacity: 1;
    visibility: visible !important; /* Make it visible when this class is added */
    transform: translateY(0) scale(1);
}

/* Class for controlling transitions during initial setup and positioning animation */
.obstacle-positioning {
    /* Slower, smoother transitions for initial placement and move to simulation spot */
    transition: opacity 0.6s ease-out,
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), /* Smoother easing for transform */
                top 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),    /* Smooth transition for top */
                left 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);   /* Smooth transition for left */
}

/* Specific styling for obstacles that are "article cards" */
.obstacle.article-card {
    background: rgba(40, 45, 60, 0.90); /* Slightly different background for article cards */
    color: #eee; /* Brighter text for article cards */
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #556;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* More pronounced shadow */
    width: 25rem; /* Specific width for article cards */
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1); /* Removed height transition */
}

/* Event cards match article card styling */
.obstacle.event-card {
    background: rgba(40, 45, 60, 0.90);
    color: #eee;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #556;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    width: 25rem;
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Specific styling for the header obstacle (if used) */
#header-obstacle {
    z-index: 3; /* Potentially higher z-index than other obstacles */
    width: 35rem; /* Custom width for the header */
    background: rgba(60, 40, 50, 0.92); /* Distinct background color */
    border-color: #887; /* Distinct border color */
    text-align: center;
    opacity: 1 !important; /* Ensure header is visible on load for SEO */
    visibility: visible !important; /* Ensure header is visible on load for SEO */
}

/* General content styling within obstacles */
.obstacle h1,
.obstacle h3 {
    margin-top: 0;
    color: #adf; /* Light blue for headings */
    border-bottom: 1px solid #556;
    padding-bottom: 0; /* Removed padding to rely on margin for spacing */
    margin-bottom: 1rem; /* Space between h3 and content */
    font-size: 1.1rem;
    font-weight: 600;
}

#header-obstacle h1 {
    font-size: 1.8rem;
    font-weight: 700;
    border-bottom: 2px solid #adf;
}

.obstacle p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.obstacle p:last-child {
    margin-bottom: 0; /* Remove bottom margin from the last paragraph */
}

/* Event card specific styles */
.event-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.duration {
    display: inline-block;
    background: #adf;
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-align: center;
    border: 1px solid #556;
}

/* ========================================= */
/* === Spaceship Simulation Cursor ======= */
/* ========================================= */

/* Cursor changes based on global interaction state classes added to body by JS */
body.placing-ship {
    cursor: crosshair;
}

body.dragging-obstacle,
body.dragging-boid {
    cursor: grabbing;
}

body.boid-hover {
    cursor: grab;
}

/* ========================================= */
/* === Booking Pages (Non-Spaceship) ===== */
/* ========================================= */

/* Styles for individual booking pages without spaceship animation */
.booking-page {
    background: var(--cal-gray-50, #f9fafb);
    color: #374151;
    font-family: Inter, "Inter Fallback", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    overflow: auto; /* Allow scrolling on booking pages */
}

.back-nav {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #e5e7eb;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #374151;
}

.back-link::before {
    content: "← ";
    margin-right: 0.25rem;
}

.cal-embed {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cal.com embed styling */
#my-cal-inline-15min,
#my-cal-inline-30min,
#my-cal-inline-60min {
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ========================================= */
/* === Responsive Design ================== */
/* ========================================= */

@media (max-width: 768px) {
    .main-content-column {
        padding: 1rem 0.5rem;
        gap: 1.5rem;
    }
    
    .article-card,
    .event-card {
        padding: 1.5rem;
        margin: 0.5rem;
        width: 95%;
        max-width: none;
    }
    
    #header-obstacle h1 {
        font-size: 2rem;
    }
    
    .event-card h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .main-content-column {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .article-card,
    .event-card {
        padding: 1rem;
    }
}

/* ========================================= */
/* === Performance Optimizations ========= */
/* ========================================= */

/* Optimize animations for better performance */
.article-card,
.event-card {
    will-change: transform;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .event-card {
        transition: none;
    }
    
    .article-card:hover,
    .event-card:hover {
        transform: none;
    }
}