/* Main Styles for Connections of Secomber - Cosmic Theme */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, h5, h6, p, ul, ol {
    margin: 0;
    padding: 0;
}

/* Cosmic-themed Variables */
:root {
    /* Rich violet/magenta tones */
    --cosmic-purple: #5e3d9e;      /* Main purple background */
    --cosmic-magenta: #b85fa1;     /* Vibrant magenta */
    --cosmic-violet: #9063db;      /* Brighter violet */
    
    /* Sky blue accents */
    --cosmic-blue: #70d6ff;        /* Bright sky blue */
    --cosmic-light-blue: #a0e3ff;  /* Lighter sky blue */
    
    /* Background gradient colors */
    --cosmic-gradient-top: #39297a; /* Darker blue-purple */
    --cosmic-gradient-bottom: #d273cb; /* Pink-purple */
    
    /* UI colors */
    --bg-dark: #2a1c5a;
    --bg-medium: #3a2970;
    --bg-light: #4b3582;
    --text-primary: #ffffff;
    --text-secondary: #d0c5ff;
    
    /* Accent colors */
    --accent-primary: var(--cosmic-magenta);
    --accent-secondary: var(--cosmic-violet);
    --border-color: #7454c0;
    --input-bg: #332366;
    --success-bg: #1a3a1a;
    --success-text: #4caf50;
    --error-bg: #3a1a1a;
    --error-text: #f44336;
    
    /* User colors - consistent across all implementations */
    /* Using RGB format to allow easy rgba usage */
    --user-jon-rgb: 125, 249, 255;   /* Electric Blue */
    --user-reba-rgb: 155, 89, 182;  /* Amethyst */
    --user-mia-rgb: 34, 139, 34;    /* Forest Green */
    --user-michael-rgb: 255, 204, 0; /* Sunrise Yellow */
    --user-jameson-rgb: 255,  69, 0; /* Crimson Orange */
    --user-natalie-rgb: 47, 79, 79; /* Shadow */
    --user-matt-rgb: 237, 255, 204;   /* Default Purple */
    --admin-rgb: 125, 249, 255;      /* Electric Blue (same as Jon) */
}

/* Base Styles */
body {
    font-family: 'Rowdies', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, var(--cosmic-gradient-top), var(--cosmic-purple), var(--cosmic-gradient-bottom));
    min-height: 100vh;
    background-attachment: fixed;
}

/* Stars in background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 25% 15%, white, transparent),
        radial-gradient(1px 1px at 50% 35%, white, transparent),
        radial-gradient(1px 1px at 75% 55%, white, transparent),
        radial-gradient(2px 2px at 20% 65%, white, transparent),
        radial-gradient(2px 2px at 40% 80%, white, transparent),
        radial-gradient(2px 2px at 60% 25%, white, transparent),
        radial-gradient(2px 2px at 80% 45%, white, transparent),
        radial-gradient(1px 1px at 10% 90%, white, transparent);
    background-repeat: repeat;
    z-index: -1;
    opacity: 0.5;
}

/* General Layout */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    width: 100%;
}

.form-container {
    background: var(--bg-medium);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* Container edge accent */
.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--cosmic-light-blue), transparent);
    opacity: 0.7;
}

/* Typography */
h1 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.intro {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.user-info {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-info a {
    color: var(--cosmic-light-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.user-info a:hover {
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--cosmic-light-blue);
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--cosmic-light-blue);
    box-shadow: 0 0 0 2px rgba(112, 214, 255, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    background: linear-gradient(to right, var(--cosmic-magenta), var(--cosmic-violet));
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 0.5rem;
    text-transform: uppercase;
    width: 100%;
}

.btn:hover {
    background: linear-gradient(to right, var(--cosmic-violet), var(--cosmic-magenta));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--cosmic-gradient-top);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

/* Notifications */
.error {
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error-text);
}

.success {
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
    border-left: 4px solid var(--success-text);
}

/* Results Page Visualization */

/* General container for hexagon visualization */
#hexagon-container {
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* Hexagon styles */
.hexagon {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    z-index: 5; /* Higher than the message display */
}

.hexagon:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Highlighted hexagon effect */
.hexagon.highlighted {
    box-shadow: 0 0 40px 15px rgba(255, 255, 255, 0.9), 0 0 80px 20px rgba(255, 255, 255, 0.5);
    z-index: 6;
    filter: brightness(1.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 40px 15px rgba(255, 255, 255, 0.9), 0 0 80px 20px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 50px 20px rgba(255, 255, 255, 0.9), 0 0 100px 30px rgba(255, 255, 255, 0.5); }
    100% { box-shadow: 0 0 40px 15px rgba(255, 255, 255, 0.9), 0 0 80px 20px rgba(255, 255, 255, 0.5); }
}

/* User-specific hexagon colors */
.hexagon.user-Jon, 
.hexagon.admin {
    background: rgba(var(--user-jon-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-jon-rgb), 0.4);
}

.hexagon.user-Reba {
    background: rgba(var(--user-reba-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-reba-rgb), 0.4);
}

.hexagon.user-Mia {
    background: rgba(var(--user-mia-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-mia-rgb), 0.4);
}

.hexagon.user-Michael {
    background: rgba(var(--user-michael-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-michael-rgb), 0.4);
}

.hexagon.user-Jameson {
    background: rgba(var(--user-jameson-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-jameson-rgb), 0.4);
}

.hexagon.user-Natalie {
    background: rgba(var(--user-natalie-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-natalie-rgb), 0.4);
}

.hexagon.user-Matt {
    background: rgba(var(--user-matt-rgb), 0.4);
    box-shadow: 0 0 15px rgba(var(--user-matt-rgb), 0.4);
}

/* Connection lines */
.connection-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Above hover message but below planets */
}

/* Hover message display */
.message-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
    color: rgba(255, 255, 255, 0.8);
}

.message-display p {
    font-size: 1.8rem;
    line-height: 1.4;
    margin: 0 0 20px 0;
    font-family: 'Rowdies', cursive;
}

.message-display .user {
    display: block;
    font-size: 1rem;
    margin-top: 20px;
    text-align: right;
    color: var(--cosmic-light-blue);
    font-family: 'Rowdies', cursive;
}

/* Carousel View */
.carousel-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.carousel-container.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 350px;
    margin: 0 auto;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: scale(0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
    pointer-events: auto;
}

/* Thought bubbles in carousel */
.thought {
    background: rgba(var(--user-matt-rgb), 0.4);
    color: var(--text-primary);
    padding: 40px;
    border-radius: 15px;
    max-width: 90%;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-family: 'Rowdies', cursive;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.thought:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.thought p {
    font-size: 1.6rem;
    line-height: 1.4;
    margin: 0 0 20px 0;
}

.thought .user {
    display: block;
    font-size: 1rem;
    margin-top: 20px;
    text-align: right;
    color: var(--cosmic-light-blue);
}

/* User-specific thought colors */
.thought.user-Jon,
.thought.admin {
    background: rgba(var(--user-jon-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-jon-rgb), 0.2);
}

.thought.user-Reba {
    background: rgba(var(--user-reba-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-reba-rgb), 0.2);
}

.thought.user-Mia {
    background: rgba(var(--user-mia-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-mia-rgb), 0.2);
}

.thought.user-Michael {
    background: rgba(var(--user-michael-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-michael-rgb), 0.2);
}

.thought.user-Jameson {
    background: rgba(var(--user-jameson-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-jameson-rgb), 0.2);
}

.thought.user-Natalie {
    background: rgba(var(--user-natalie-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-natalie-rgb), 0.2);
}

.thought.user-Matt {
    background: rgba(var(--user-matt-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--user-matt-rgb), 0.2);
}

/* Carousel Controls */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.dots-container {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 80%;
    max-width: 400px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

.counter {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    opacity: 0.8;
}

.controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 1000;
    padding: 0 10px;
}

.controls a {
    background: linear-gradient(to right, var(--cosmic-magenta), var(--cosmic-violet));
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.controls a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    background: linear-gradient(to right, var(--cosmic-violet), var(--cosmic-magenta));
}

.no-thoughts {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background: rgba(42, 28, 90, 0.7);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #7454c0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
}

.no-thoughts h2 {
    margin-bottom: 1rem;
    color: var(--cosmic-light-blue);
}

/* Responsive styles */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        max-width: 100%;
        margin: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .thought {
        padding: 25px;
        max-width: 90%;
    }
    
    .message-display p {
        font-size: 1.5rem;
    }
    
    .nav-button {
        width: 40px;
        height: 40px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    /* Adjust carousel for smaller screens */
    .carousel {
        height: auto;
        padding-bottom: 60px;
    }
    
    .dots-container {
        bottom: -40px;
    }
    
    .counter {
        bottom: -70px;
    }
}

/* Even smaller screens */
@media (max-width: 480px) {
    .form-container {
        padding: 1.2rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .thought {
        padding: 20px;
    }
    
    .thought p {
        font-size: 1.3rem;
    }
    
    .message-display p {
        font-size: 1.3rem;
    }
    
    /* Make navigation larger for touch */
    .nav-button, .close-button {
        width: 44px;
        height: 44px;
    }
    
    .controls a {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
}