/* vibecoding.nu style variables for Watercooler game */
:root {
    --primary-color: #8A2BE2;    /* Purple */
    --secondary-color: #FF1493;  /* Pink */
    --accent-color: #00FFFF;     /* Cyan */
    --bg-color: #121212;         /* Dark background */
    --text-color: #FFFFFF;       /* White text */
    --card-bg-color: rgba(255, 255, 255, 0.1); /* Semi-transparent card background */
    --transition-speed: 0.3s;    /* Standard transition speed */
    
    /* Watercooler game specific variables */
    --awkward-red: #ff5252;
    --success-green: #69f0ae;
    --neutral-blue: #40c4ff;
    --light-card-bg: rgba(255, 255, 255, 0.15);
    --grid-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.5s ease;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

header {
    text-align: center;
    padding: 30px 0;
    animation: fadeIn 1s ease-in;
    border-bottom: none;
    box-shadow: none;
    background-color: transparent;
}

h1 {
    color: var(--primary-color);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.tagline {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 0;
    font-style: normal;
    opacity: 1;
}

/* Game area styling */
.game-area {
    display: flex;
    margin-top: 30px;
    gap: 20px;
    height: 500px;
    animation: fadeIn 1s ease-in;
}

.office-scene {
    flex: 2;
    background-color: var(--card-bg-color);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.office-scene:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(138, 43, 226, 0.5);
}

.water-cooler-bg {
    background-size: cover;
    background-position: center;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    background-color: rgba(40, 40, 40, 0.8);
    border-radius: 15px;
}

.coworker {
    position: absolute;
    width: 120px;
    height: 240px;
    bottom: 60px;
    left: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    transition: all 0.5s ease;
    filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.5));
}

.coworker-name {
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    text-align: center;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    transition: all var(--transition-speed);
}

.player {
    position: absolute;
    width: 120px;
    height: 240px;
    bottom: 60px;
    right: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
}

.water-cooler {
    position: absolute;
    width: 80px;
    height: 160px;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 15px rgba(64, 196, 255, 0.7));
}

.dialog-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-stats {
    background-color: var(--card-bg-color);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    padding: 15px;
    margin-bottom: 20px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.game-stats:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(138, 43, 226, 0.5);
}

.stats-title {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.awkwardness-meter {
    height: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.awkwardness-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--success-green), var(--awkward-red));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.conversation {
    background-color: var(--card-bg-color);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.conversation:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(138, 43, 226, 0.5);
}

.conversation-history {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: rgba(20, 20, 30, 0.5);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.1);
}

.conversation-history::-webkit-scrollbar {
    width: 8px;
}

.conversation-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.conversation-history::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}

.message {
    padding: 12px 18px;
    margin-bottom: 15px;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: messageAppear 0.3s ease-out;
}

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

.coworker-msg {
    background-color: var(--light-card-bg);
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border-left: 3px solid var(--neutral-blue);
}

.player-msg {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    border-right: 3px solid var(--accent-color);
}

.user-input {
    display: flex;
    padding: 15px;
    background-color: rgba(30, 30, 40, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.response-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.response-option {
    padding: 12px 18px;
    background-color: var(--card-bg-color);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.response-option:hover, .response-option:focus {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
}

.response-option::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 10%, transparent 40%);
    opacity: 0;
    transform: scale(0.1);
    transition: all 0.5s;
    z-index: -1;
}

.response-option:hover::before, .response-option:focus::before {
    opacity: 0.5;
    transform: scale(1);
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.control-btn {
    padding: 12px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    position: relative;
    z-index: 1;
}

.control-btn:hover, .control-btn:focus {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.8);
    outline: none;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 10%, transparent 40%);
    opacity: 0;
    transform: scale(0.1);
    transition: all 0.5s;
    z-index: -1;
}

.control-btn:hover::before, .control-btn:focus::before {
    opacity: 0.5;
    transform: scale(1);
}

.topics-btn {
    background: linear-gradient(45deg, var(--accent-color), var(--primary-color));
}

.new-convo {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

.coworker-profile {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 15px 20px;
    background-color: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
    display: none;
    border: 1px solid var(--primary-color);
    transition: all var(--transition-speed);
}

.profile-visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.profile-title {
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.profile-detail {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-color);
}

.profile-detail b {
    color: var(--accent-color);
}

.level-indicator {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

/* Background animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-animation span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
    animation: animate 5s linear infinite;
    will-change: transform;
}

.bg-animation span:nth-child(even) {
    background: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
}

/* Menu toggle */
.menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    z-index: 200;
    transition: all var(--transition-speed);
}

.menu-toggle:hover, .menu-toggle:focus {
    transform: scale(1.1);
    outline: none;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: all var(--transition-speed);
}

/* Footer styling */
footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: var(--secondary-color);
}

/* Animations */
@keyframes animate {
    0% {
        transform: translateY(100vh) scale(0);
    }
    100% {
        transform: translateY(-100vh) scale(1);
    }
}

/* Responsive design - WhatsApp-style mobile layout */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    /* Full-height chat interface with iOS fix */
    body, .container, main {
        height: 100vh; /* Fallback */
        height: calc(var(--vh, 1vh) * 100); /* iOS fix */
        max-height: 100vh;
        max-height: calc(var(--vh, 1vh) * 100);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    main {
        flex: 1;
        position: relative;
    }
    
    header {
        padding: 15px 0;
    }
    
    /* Collapsed game area for mobile */
    .game-area {
        flex-direction: column;
        height: 100%;
        margin-top: 0;
        gap: 0;
    }
    
    /* Fixed header with coworker info */
    .mobile-coworker-header {
        display: flex;
        background-color: rgba(20, 20, 30, 0.8);
        padding: 10px;
        align-items: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        position: relative;
        z-index: 10;
    }
    
    .mobile-coworker-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 12px;
        background-color: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
    }
    
    .mobile-coworker-info {
        flex: 1;
    }
    
    .mobile-coworker-name {
        font-weight: bold;
        margin-bottom: 2px;
        color: var(--accent-color);
    }
    
    .mobile-status {
        font-size: 0.8rem;
        opacity: 0.8;
    }
    
    /* Hide desktop scene on mobile */
    .office-scene {
        display: none;
    }
    
    /* Full height dialog area */
    .dialog-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .game-stats {
        border-radius: 0;
        margin-bottom: 0;
        padding: 8px 15px;
    }
    
    /* Chat-style conversation */
    .conversation {
        flex: 1;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        height: 100%;
        padding-bottom: 55px; /* Space for fixed controls */
    }
    
    .conversation-history {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        background-color: var(--bg-color);
        background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2V0h2v20h2v2H20v-1.5zM0 20h2v20H0V20zm4 0h2v20H4V20zm4 0h2v20H8V20zm4 0h2v20h-2V20zm4 0h2v20h-2V20zm4 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2z' fill='rgba(138, 43, 226, 0.05)' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    }
    
    .message {
        max-width: 85%;
        padding: 10px 12px;
        margin-bottom: 8px;
        font-size: 0.95rem;
    }
    
    .user-input {
        padding: 10px;
        background-color: rgba(20, 20, 30, 0.8);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .response-options {
        gap: 8px;
    }
    
    .response-option {
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 18px;
    }
    
    /* Bottom navigation bar */
    .controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(20, 20, 30, 0.9);
        backdrop-filter: blur(10px);
        z-index: 100;
        margin: 0;
        padding: 8px 10px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .control-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    
    /* Hide regular footer on mobile */
    footer {
        display: none;
    }
    
    /* Coworker profile for mobile */
    .coworker-profile {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 320px;
        z-index: 200;
    }
}

/* Accessibility focus styles */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Prefers reduced motion media query */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .bg-animation span {
        animation: none !important;
    }
}

/* Sparkle effect for interactions */
.sparkle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9999;
    animation: sparkle-animation 1s forwards;
}

@keyframes sparkle-animation {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1) rotate(180deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}