/* CSS Custom Properties */
:root {
    --container-min-height: 400px;

    /* Refugium element positioning */
    --ground-level: 50px;      /* Universal ground plane - adjust to move all elements up/down */
    --slot1-offset: 40px;       /* Fine-tune slot 1 (left tree) position */
    --slot2-offset: 0px;       /* Fine-tune slot 2 (right tree) position */
    --slot3-offset: 15px;       /* Fine-tune slot 3 (center bush) position */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f6f6f6 0%, #f6f6f6 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Container */
.container {
    max-width: 800px;
    width: 100%;
}

/* Header */
header {
    text-align: center;
    color: #a89595;
    margin-bottom: 40px;
    position: relative;
}

.logo {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 999;
    max-width: 170px;
    width: 100%;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-login {
    position: flex;
    top: 40px;
    left: 40px;
    z-index: 999;
    max-width: 170px;
    width: 100%;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.header-actions {
    margin-top: 15px;
}

.logout-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

header h1 {
    font-size: 48px;
    font-weight: 400;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
}

/* Main Content */
main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.mood-card {
    text-align: center;
}

.mood-card h2 {
    color: #3c3020;
    font-size: 28px;
    margin-bottom: 15px;
}

.mood-card p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    opacity: 0.8;
    font-size: 14px;
}

/* Auth Forms */
.auth-card {
    max-width: 400px;
    margin: 0 auto;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #7a525f;
}

.field-error {
    display: block;
    color: #d32f2f;
    font-size: 14px;
    margin-top: 5px;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    border-width: 0px;
    background: linear-gradient(135deg, #d7aab5 0%, #b55753 100%);
    color: white;
    width: 100%;
    padding: 0.5rem;
}

.auth-link {
    text-align: center;
    color: #666;
}

.auth-link a {
    color: #7a525f;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Mood Entry Form */
.mood-form {
    margin-top: 20px;
}

.mood-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.mood-textarea:focus {
    outline: none;
    border-color: #7a525f;
}

/* Mood History */
.mood-history {
    margin-top: 40px;
}

.mood-history h3 {
    color: #3c3020;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.mood-entry {
    background: #f9f9f9;
    border-left: 4px solid #7a525f;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mood-entry:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mood-entry-header {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.mood-date {
    color: #7a525f;
    font-size: 14px;
    font-weight: 600;
}

.sentiment-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

/* Emotion badge colors */
.sentiment-badge.sentiment-joy {
    background-color: #fff9c4;
    color: #f57f17;
}

.sentiment-badge.sentiment-anger {
    background-color: #ffebee;
    color: #c62828;
}

.sentiment-badge.sentiment-sadness {
    background-color: #e3f2fd;
    color: #1565c0;
}

.sentiment-badge.sentiment-fear {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.sentiment-badge.sentiment-surprise {
    background-color: #fff3e0;
    color: #e65100;
}

.sentiment-badge.sentiment-disgust {
    background-color: #e0f2f1;
    color: #00695c;
}

.sentiment-badge.sentiment-neutral {
    background-color: #f5f5f5;
    color: #666;
}

/* Colored border based on emotion */
.mood-entry.sentiment-joy {
    border-left-color: #fbc02d;
}

.mood-entry.sentiment-anger {
    border-left-color: #f44336;
}

.mood-entry.sentiment-sadness {
    border-left-color: #2196f3;
}

.mood-entry.sentiment-fear {
    border-left-color: #9c27b0;
}

.mood-entry.sentiment-surprise {
    border-left-color: #ff9800;
}

.mood-entry.sentiment-disgust {
    border-left-color: #009688;
}

.mood-entry.sentiment-neutral {
    border-left-color: #9e9e9e;
}

.mood-entry-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 12px;
}

.emotions-detail {
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
}

.emotions-detail strong {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

.emotion-chip {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    border: 1px solid #e0e0e0;
}

/* Emotion Interpretation */
.emotion-interpretation {
    padding: 12px;
    margin-top: 12px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #7a525f;
    font-size: 13px;
}

.emotion-interpretation strong {
    color: #333;
    margin-right: 8px;
}

.interp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.interp-badge.interp-high {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.interp-badge.interp-mixed {
    background-color: #fff3e0;
    color: #e65100;
}

.interp-badge.interp-moderate {
    background-color: #e3f2fd;
    color: #1565c0;
}

.interp-badge.interp-low {
    background-color: #f5f5f5;
    color: #757575;
}

.recommend-for {
    display: inline-block;
    margin-left: 10px;
    color: #666;
}

.recommend-for strong {
    color: #7a525f;
    text-transform: capitalize;
}

.no-entries {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

.message.info {
    background-color: #e3f2fd;
    color: #1565c0;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
}

/* Video Recommendations Section */
.recommendations-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f4f5 0%, #f0e8eb 100%);
    border-radius: 15px;
    border: 2px solid #a89499;
}

/* 1. Target the player element directly */
.custom-audio-player {
    /* Make the player fill the width of its container */
    width: 100%;
    
    /* Ensure the browser renders the controls with a defined height */
    min-height: 40px; 
    
    /* Add some margin to separate it from other elements */
    margin-top: 15px;
    margin-bottom: 15px;
    
    /* Use 'display: block' to ensure 100% width works properly */
    display: block;
}

.recommendations-section h3 {
    color: #3c3020;
    font-size: 26px;
    margin-bottom: 10px;
    text-align: center;
}

.recommendations-intro {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
    gap: 10px;
}

.video-header h4 {
    color: #3c3020;
    font-size: 18px;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.video-duration {
    background-color: #7a525f;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.video-description {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.difficulty-badge.difficulty-easy {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.difficulty-badge.difficulty-medium {
    background-color: #fff3e0;
    color: #e65100;
}

.difficulty-badge.difficulty-hard {
    background-color: #ffebee;
    color: #c62828;
}

.emotion-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.emotion-tag {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    color: #666;
    border: 1px solid #e0e0e0;
    text-transform: capitalize;
}

.btn-video {
    background: linear-gradient(135deg, #7a525f 0%, #5a3a47 100%);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 82, 95, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .recommendations-section {
        padding: 20px;
    }
}

/* ===== REFUGIUM SYSTEM STYLES ===== */

/* Header with Navigation */
.header {
    text-align: center;
    color: #cbbcbc;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 40px;
    font-weight: 400;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s;
    font-size: 14px;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Stats Bar */
.refugium-stats {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    justify-content: space-evenly;
    margin-bottom: 20px;
    margin-top: 40px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-emoji {
    font-size: 1.3em;
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: #3c3020;
}

/* Refugium Visualization Container */
.refugium-container {
    background: white;
    border-radius: 20px;
    margin-bottom: 20px;
    padding: 40px;
    box-shadow: 0 0px 12px rgba(0, 0, 0, 0.3);
    min-height: 500px;
    position: relative;
}

/* Wrapper to contain the scaled landscape and provide proper layout space */
.refugium-landscape-wrapper {
    position: relative;
    width: 800px;
    max-width: 100%;  /* Prevent overflow */
    height: 400px;
    margin: 0 auto;  /* Center horizontally */
    overflow: hidden;
}

.refugium-landscape {
    position: absolute;
    top: 0;
    width: 700px;
    height: 400px;
    background: linear-gradient(to bottom, #87ceeb 0%, #98d8c8 70%, #7cb342 100%);
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    overflow: hidden;
    transform-origin: top left;  /* Scale from center, already positioned at 50% */
}

/* Seasonal and time-based background images */
/* Spring backgrounds */
.refugium-container.season-spring.time-morning .refugium-landscape,
.refugium-container.season-spring.time-day .refugium-landscape,
.refugium-container.season-spring.time-evening .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/spring-day.jpg');
}

.refugium-container.season-spring.time-night .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/spring-night.jpg');
}

/* Summer backgrounds */
.refugium-container.season-summer.time-morning .refugium-landscape,
.refugium-container.season-summer.time-day .refugium-landscape,
.refugium-container.season-summer.time-evening .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/summer-day.jpg');
}

.refugium-container.season-summer.time-night .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/summer-night.jpg');
}

/* Autumn backgrounds */
.refugium-container.season-autumn.time-morning .refugium-landscape,
.refugium-container.season-autumn.time-day .refugium-landscape,
.refugium-container.season-autumn.time-evening .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/autumn-day.jpg');
}

.refugium-container.season-autumn.time-night .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/autumn-night.jpg');
}

/* Winter backgrounds */
.refugium-container.season-winter.time-morning .refugium-landscape,
.refugium-container.season-winter.time-day .refugium-landscape,
.refugium-container.season-winter.time-evening .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/winter-day.jpg');
}

.refugium-container.season-winter.time-night .refugium-landscape {
    background-image: url('/static/gamification/refugium/backgrounds/winter-night.jpg');
}

/* Sky and Ground */
.sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    z-index: 1;
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(124, 179, 66, 0.3) 0%, rgba(124, 179, 66, 0.6) 100%);
    z-index: 2;
}

/* Yurt Entry Button */
.yurt-entry {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.yurt-link {
    text-decoration: none;
}

.yurt-button {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.yurt-button:hover {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}

.yurt-icon {
    display: none;
}

.yurt-text {
    color: white;
    font-weight: 500;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Growth Elements */
.growth-elements {
    position: relative;
    z-index: 5;
    height: 100%;
    min-height: var(--container-min-height);
    width: 100%;
}

.element {
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s;
    cursor: default;
    animation: fadeIn 0.5s ease-in;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.element:hover {
    transform: scale(1.15);
}

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

/* Element images */
.element-plant_small {
    width: 34px;
    height: 36px;
    background-image: url('/static/gamification/refugium/elements/plant-small.png');
}

.element-small_bush {
    width: 50px;
    height: 50px;
    background-image: url('/static/gamification/refugium/elements/small-bush.png');
}

.element-bush {
    width: 70px;
    height: 70px;
    background-image: url('/static/gamification/refugium/elements/bush.png');
}

.element-large_bush {
    width: 90px;
    height: 90px;
    background-image: url('/static/gamification/refugium/elements/large-bush.png');
}

.element-blossom_bush {
    width: 100px;
    height: 100px;
    background-image: url('/static/gamification/refugium/elements/blossom-bush.png');
}

.element-young_tree {
    width: 180px;
    height: 205px;
    background-image: url('/static/gamification/refugium/elements/young-tree.png');
}

.element-tree {
    width: 228px;
    height: 200px;
    background-image: url('/static/gamification/refugium/elements/tree.png');
}

.element-tree_blossom {
    width: 280px;
    height: 330px;
    background-image: url('/static/gamification/refugium/elements/tree-blossom.png');
}

.element-sitting_stone {
    width: 80px;
    height: 36px;
    background-image: url('/static/gamification/refugium/elements/sitting-stone.png');
}

.element-fireplace {
    width: 55px;
    height: 59px;
    background-image: url('/static/gamification/refugium/elements/campfire.png');
}

.element-path {
    width: 193px;
    height: 119px;
    background-image: url('/static/gamification/refugium/elements/path.png');
}

.element-butterfly {
    width: 50px;
    height: 50px;
    background-image: url('/static/gamification/refugium/elements/butterfly.png');
}

.element-bird {
    width: 50px;
    height: 50px;
    background-image: url('/static/gamification/refugium/elements/bird.png');
}

.element-deer {
    width: 90px;
    height: 100px;
    background-image: url('/static/gamification/refugium/elements/deer.png');
}

.element-fox {
    width: 80px;
    height: 70px;
    background-image: url('/static/gamification/refugium/elements/fox.png');
}

.element-rainbow {
    width: 150px;
    height: 80px;
    background-image: url('/static/gamification/refugium/elements/rainbow.png');
}

.element-stars {
    width: 60px;
    height: 60px;
    background-image: url('/static/gamification/refugium/elements/stars.png');
}

.element-moon {
    width: 60px;
    height: 60px;
    background-image: url('/static/gamification/refugium/elements/moon.png');
}

.element-sun {
    width: 70px;
    height: 70px;
    background-image: url('/static/gamification/refugium/elements/sun.png');
}

/* Element positioning - Fixed pixels on 800×400 canvas */

/* SLOT-BASED POSITIONING FOR GROWTH ELEMENTS */
/* All slots use unified ground level with optional individual offsets */
/* Easy to adjust: change --ground-level in :root to move all elements */
/* Fine-tune: adjust individual --slotN-offset variables */

/* Slot 1 - Left position (trees only) */
[data-slot="1"] {
    bottom: calc(var(--ground-level) + var(--slot1-offset));
    left: 30px;
}

/* Slot 2 - Right position (trees only) */
[data-slot="2"] {
    bottom: calc(var(--ground-level) + var(--slot2-offset));
    right: -10px;
}

/* Slot 3 - Center position (bushes only) */
[data-slot="3"] {
    bottom: calc(var(--ground-level) + var(--slot3-offset));
    left: 290px;
}

/* Fixed decorative elements (slot 0) */
.element-sitting_stone { bottom: 10px; left: 50px; }
.element-fireplace { bottom: 32px; left: 139px; }
.element-campfire { bottom: 48px; left: 240px; }

/* Path */
.element-path { bottom: 0; left: 243px; }

/* Animals on ground */
.element-deer { bottom: 140px; left: 160px; }
.element-fox { bottom: 120px; left: 240px; }

/* Bird on yurt (center top) */
.element-bird { bottom: 192px; left: 404px; }

/* Butterfly flying */
.element-butterfly { top: 140px; right: 200px; }

@keyframes flutter {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-15px) translateX(10px); }
}

@keyframes fly {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

/* Empty State */
.empty-message {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.empty-message p {
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
}

/* Progress Message */
.progress-message {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.progress-message p {
    color: #3c3020;
    font-size: 16px;
    margin: 0;
}

/* ===== YURT INTERIOR STYLES ===== */

.yurt-interior {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.yurt-ambiance {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.fireplace-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fire-emoji {
    font-size: 80px;
    animation: flicker 2s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.fire-message {
    color: #d84315;
    font-size: 20px;
    font-weight: 600;
    margin-top: 15px;
}

.interior-stats {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.interior-stats p {
    color: #666;
    margin: 8px 0;
    font-size: 16px;
}

/* Exercises Section */
.exercises-section {
    margin-top: 30px;
}

.exercises-section h2 {
    color: #3c3020;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.section-intro {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.exercise-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #d7aab5;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    gap: 10px;
}

.exercise-header h3 {
    color: #3c3020;
    font-size: 18px;
    margin: 0;
    flex: 1;
}

.exercise-duration {
    background: linear-gradient(135deg, #d7aab5 0%, #b55753 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.exercise-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exercise-description {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.exercise-meta {
    margin-bottom: 15px;
}

.exercise-difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.exercise-emotions {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.btn-exercise {
    background: linear-gradient(135deg, #d7aab5 0%, #b55753 100%);
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: auto;
}

.btn-exercise:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 82, 95, 0.3);
}

.empty-exercises {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-exercises p {
    margin-bottom: 10px;
}

/* ===== EXERCISE DETAIL STYLES ===== */

.exercise-detail {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.exercise-info-box {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.exercise-meta-detail {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.meta-item {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background-color: #e0e0e0;
}

.exercise-description-full {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.target-emotions-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.emotion-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.emotion-badge.emotion-fear {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.emotion-badge.emotion-sadness {
    background-color: #e3f2fd;
    color: #1565c0;
}

.emotion-badge.emotion-anger {
    background-color: #ffebee;
    color: #c62828;
}

.emotion-badge.emotion-joy {
    background-color: #fff9c4;
    color: #f57f17;
}

/* Video Container */
.video-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-container iframe,
.video-container video {
    width: 100%;
    height: 500px;
    display: block;
}

/* Completion Form */
.completion-form-box {
    background: linear-gradient(135deg, #f8f4f5 0%, #f0e8eb 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.completion-form-box h2 {
    color: #3c3020;
    font-size: 24px;
    margin-bottom: 10px;
}

.completion-form-box p {
    color: #666;
    margin-bottom: 20px;
}

.completion-form .form-group {
    margin-bottom: 20px;
}

.completion-form label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.completion-form select,
.completion-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.completion-form select:focus,
.completion-form textarea:focus {
    outline: none;
    border-color: #7a525f;
}

.btn-complete {
    width: 100%;
    margin-top: 10px;
}

/* Back Button */
.back-button {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background-color: #e0e0e0;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    opacity: 0.8;
    font-size: 14px;
}

/* Messages (Global) */
.messages {
    margin-bottom: 20px;
}

/* ===== GROUP REFUGIUM PHASE 2 STYLES ===== */

/* Two-Column Layout: Refugium (60%) + Activity Feed (40%) */
.group-content-wrapper {
    display: flex;
    grid-template-columns: 70% 30%;
    gap: 0px;
    margin-bottom: 30px;
}

/* Activity Feed Container */
.activity-feed {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 700px;
    overflow-y: auto;
}

.activity-feed h2 {
    color: #3c3020;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
}

/* Comment Form */
.comment-form-container {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    transition: border-color 0.3s;
    min-height: 80px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #7a525f;
    box-shadow: 0 0 0 3px rgba(122, 82, 95, 0.1);
}

.comment-form .btn-primary {
    border-width: 0px;
    background: linear-gradient(135deg, #d7aab5 0%, #b55753 100%);
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Activity Item Cards */
.activity-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

/* Activity Exercise */
.activity-exercise {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-user {
    font-weight: 700;
    color: #7a525f;
    font-size: 14px;
}

.activity-text {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.activity-text strong {
    color: #3c3020;
    font-weight: 600;
}

.activity-feeling {
    display: inline-block;
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.activity-time {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* Activity Comment */
.activity-comment {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* System Message Styling */
.activity-comment.system-message {
    background: rgba(168, 148, 153, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 12px 0;
}

.system-message-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.system-message-text {
    color: #7a525f;
    font-style: italic;
    font-size: 14px;
    font-weight: 500;
}

.system-message-time {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* Activity Exercise */
.activity-exercise {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Comment Header with Avatar */
.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-avatar,
.comment-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168, 148, 153, 0.3);
    flex-shrink: 0;
}

.comment-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 148, 153, 0.1);
    font-size: 1.2rem;
}

.comment-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Exercise Header with Avatar (same styling as comments) */
.exercise-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.exercise-avatar,
.exercise-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168, 148, 153, 0.3);
    flex-shrink: 0;
}

.exercise-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 148, 153, 0.1);
    font-size: 1.2rem;
}

.exercise-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Reply Header with Avatar */
.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.reply-avatar,
.reply-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168, 148, 153, 0.3);
    flex-shrink: 0;
}

.reply-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 148, 153, 0.1);
    font-size: 1rem;
}

.reply-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Reaction Buttons */
.reactions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.reaction-btn:hover {
    transform: scale(1.08);
    border-color: #7a525f;
    box-shadow: 0 2px 8px rgba(122, 82, 95, 0.15);
}

.reaction-btn.active {
    background: linear-gradient(135deg, #a89499 0%, #7a525f 100%);
    border-color: #7a525f;
    color: white;
}

.reaction-btn.active:hover {
    box-shadow: 0 3px 12px rgba(122, 82, 95, 0.3);
}

.reaction-btn .count {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    margin-left: 2px;
}

/* Reaction Summary Display (New System) */
.reaction-summary {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.reaction-pill:hover {
    background-color: #e8e8e8;
    border-color: #7a525f;
    transform: scale(1.05);
}

.reaction-pill.user-reacted {
    background: linear-gradient(135deg, #a89499 0%, #7a525f 100%);
    border-color: #7a525f;
    color: white;
    font-weight: 600;
}

.reaction-pill.user-reacted:hover {
    box-shadow: 0 2px 8px rgba(122, 82, 95, 0.25);
}

.reaction-summary-small {
    margin-top: 8px;
}

.reaction-summary-small .reaction-pill {
    font-size: 12px;
    padding: 3px 8px;
}

/* No Activity Message */
.no-activity {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* Group Members Section */
.group-members-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.group-members-section h2 {
    color: #3c3020;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
}

.members-list {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.member-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
    border-color: #7a525f;
}

.member-name {
    font-weight: 600;
    color: #3c3020;
    font-size: 0.8rem;
    padding: 2px;
}

.member-badge {
    background: linear-gradient(135deg, #d7aab5  0%, #b55753 100%);
    color: white;
    padding: 4px 4px;
    border-radius: 10px;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Achievements Section */
.achievements-section {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    
}

.achievements-section h2 {
    color: #3c3020;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: white;
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.achievement-emoji {
    font-size: 48px;
    line-height: 1;
}

.achievement-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.achievement-name {
    font-size: 18px;
    font-weight: 700;
    color: #3c3020;
}

.achievement-meta {
    font-size: 13px;
    color: #666;
}

/* Leave Group Section */
.leave-group-section {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .refugium-stats {
        grid-template-columns: 1fr 1fr;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
    }

    .exercises-grid {
        grid-template-columns: 1fr;
    }

    .yurt-structure {
        font-size: 70px;
    }

    .element {
        font-size: 30px;
    }

    /* Stack two-column layout on mobile */
    .group-content-wrapper {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .activity-feed {
        max-height: 700px;
    }

    .members-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   MULTI-GROUP & INVITATION SYSTEM STYLES
   ============================================================ */

/* Group Switcher */
.group-switcher {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.group-switcher label {
    font-weight: 600;
    color: #3c3020;
    font-size: 16px;
}

.group-switcher select {
    flex: 1;
    max-width: 400px;
    padding: 10px 15px;
    border: 2px solid #7a525f;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.group-switcher select:hover {
    border-color: #5a3d47;
}

.group-switcher select:focus {
    outline: none;
    border-color: #7a525f;
    box-shadow: 0 0 0 3px rgba(122, 82, 95, 0.1);
}

/* Invitation Badge in Navigation */
.invite-badge-link {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 20px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.invite-badge-link:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04856 100%);
    transform: scale(1.05);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
}

/* Invitations Page */
.invitations-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.invitations-section h2 {
    color: #5a5a5a;
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-align: center;
}

.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.invitation-card {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 2px solid #7a525f;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.invitation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 82, 95, 0.2);
}

.invitation-info {
    flex: 1;
}

.invitation-group-name {
    color: #3c3020;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.invitation-meta {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.invitation-group-info {
    color: #888;
    font-size: 13px;
    margin: 8px 0 0 0;
}

.invitation-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    color: #333;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-message {
    font-size: 24px;
    color: #3c3020;
    margin-bottom: 15px;
}

.empty-state p:last-child {
    color: #666;
    font-size: 16px;
}

/* Pending Invites in Group Manage */
.pending-invites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pending-invite-row {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invite-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.invite-user {
    font-weight: 700;
    color: #3c3020;
    font-size: 16px;
}

.invite-date {
    font-size: 13px;
    color: #888;
}

/* Responsive Design */
@media (max-width: 768px) {
    .group-switcher {
        flex-direction: column;
        align-items: stretch;
    }

    .group-switcher select {
        max-width: none;
    }

    .invitation-card {
        flex-direction: column;
        align-items: stretch;
    }

    .invitation-actions {
        width: 100%;
    }

    .invitation-actions button {
        flex: 1;
    }

    .pending-invite-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* Group Management Styles */
.manage-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(168, 148, 153, 0.15);
}

.manage-section h2 {
    color: #7a525f;
    margin: -30px -30px 25px -30px;
    padding: 20px 30px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(168, 148, 153, 0.15) 0%, rgba(122, 82, 95, 0.1) 100%);
    border-bottom: 3px solid #a89499;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
}

.group-form {
    max-width: 500px;
}

.group-form .form-group {
    margin-bottom: 20px;
}

.group-form label {
    display: block;
    margin-bottom: 8px;
    color: #5a5a5a;
    font-weight: 600;
}

.group-form input[type="text"],
.group-form select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.group-form input[type="text"]:focus,
.group-form select:focus {
    outline: none;
    border-color: #a89499;
    box-shadow: 0 0 0 3px rgba(168, 148, 153, 0.1);
}

.members-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(168, 148, 153, 0.08);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.member-row:hover {
    background: rgba(168, 148, 153, 0.15);
}

.member-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.member-name {
    font-weight: 600;
    color: #333;
    font-size: 0.8rem;
}

.member-badge {
    display: inline-block;
    padding: 4px 4px;
    background: linear-gradient(135deg, #d7aab5  0%, #b55753 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-date {
    color: #777;
    font-size: 0.9rem;
}

.no-members {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.pending-invites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pending-invite-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.invite-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.invite-user {
    font-weight: 600;
    color: #333;
    font-size: 1.05rem;
}

.invite-date {
    color: #777;
    font-size: 0.85rem;
}

.btn-secondary {
    background: linear-gradient(135deg, #9e9e9e 0%, #616161 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #757575 0%, #424242 100%);
}

.info-message {
    color: #5a5a5a;
    padding: 15px;
    background: rgba(168, 148, 153, 0.1);
    border-radius: 8px;
    text-align: center;
}

/* Mobile responsiveness for manage section */
@media (max-width: 768px) {
    .member-row,
    .pending-invite-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .member-row form,
    .pending-invite-row form {
        width: 100%;
    }

    .member-row button,
    .pending-invite-row button {
        width: 100%;
    }
}

/* Threaded Comments / Reply System */
.reply-btn {
    background: none;
    border: none;
    color: #7a525f;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 10px;
    margin-top: 5px;
    transition: color 0.2s ease;
}

.reply-btn:hover {
    color: #a89499;
    text-decoration: underline;
}

.reply-form {
    margin-top: 15px;
    padding: 15px;
    background: rgba(168, 148, 153, 0.08);
    border-radius: 8px;
    border-left: 3px solid #a89499;
}

.reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #a89499;
}

.reply-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.replies-list {
    margin-top: 15px;
    margin-left: 30px;
    padding-left: 15px;
    border-left: 3px solid rgba(168, 148, 153, 0.3);
}

.reply-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: rgba(168, 148, 153, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background-color 0.15s ease;
}

/* Highlight only the specific reply when hovered */
.reply-item:hover {
    background: rgba(168, 148, 153, 0.12);
    cursor: pointer;
}

.reply-user {
    font-weight: 600;
    color: #7a525f;
    font-size: 0.95rem;
}

.reply-text {
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
}

.reply-time {
    color: #999;
    font-size: 0.8rem;
}

.reactions-small {
    margin-top: 8px;
}

.reactions-small .reaction-btn {
    padding: 4px 8px;
    font-size: 0.9rem;
}

/* Mobile responsiveness for threaded comments */
@media (max-width: 768px) {
    .replies-list {
        margin-left: 15px;
        padding-left: 10px;
    }

    .reply-form-actions {
        flex-direction: column;
    }

    .reply-form-actions button {
        width: 100%;
    }

    /* Hide logo on small displays (except login/signup which will have their own rule) */
    .header .logo {
        display: none;
    }
}

/* Show logo only on login and signup pages on mobile */
body:has(.auth-form) .header .logo {
    display: block !important;
}

/* Icon-Based Navigation System */
.icon-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
}

.icon-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #5a5a5a;
    transition: all 0.3s ease;
}

.icon-nav a img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.icon-nav a:hover img {
    transform: scale(1.1);
}

.icon-nav a.active {
    color: #7a525f;
}

.icon-nav a.active img {
    filter: brightness(0.9) saturate(1.2);
}

.icon-nav-label {
    font-size: 0.75rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Mobile Navigation (bottom, fixed, icons only) */
@media (max-width: 767px) {
    .icon-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 10px 5px;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        border-top: 2px solid rgba(168, 148, 153, 0.2);
    }

    .icon-nav a {
        flex: 1;
        padding: 5px;
    }

    .icon-nav a img {
        width: 40px;
        height: 40px;
    }

    /* Hide text labels on mobile */
    .icon-nav-label {
        display: none;
    }

    /* Add padding to body to prevent content from being hidden under nav */
    body {
        padding-bottom: 70px;
    }

    /* Moderator settings icon (top right) */
    .moderator-settings-icon {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 999;
        background: rgba(168, 148, 153, 0.9);
        backdrop-filter: blur(5px);
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
    }

    .moderator-settings-icon:hover {
        transform: scale(1.1);
        background: rgba(168, 148, 153, 0.1);
    }

    .moderator-settings-icon a {
        color: white;
        font-size: 1.5rem;
        text-decoration: none;
    }
}

/* Desktop Navigation (left, icons + text) */
@media (min-width: 768px) {
    .icon-nav { 
        position: fixed;
        flex-direction: column;
        top: 250px;
        left: 20px;
        z-index: 999;
        display: flex;
        align-items: left;
        justify-content: left;
        background: rgba(255, 255, 255, 0.95);
        padding: 20px 15px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        margin-bottom: 20px;
        transition: all 0.3s ease;
        align-items: flex-start;
    }

    .icon-nav a {
        flex-direction: row;
        gap: 10px;
        padding: 10px 15px;
        border-radius: 8px;
    }

    .icon-nav a:hover {
        background: rgba(168, 148, 153, 0.1);
    }

    .icon-nav a.active {
        background: linear-gradient(135deg, rgba(168, 148, 153, 0.2) 0%, rgba(122, 82, 95, 0.15) 100%);
        font-weight: 600;
    }

    .icon-nav a img {
        width: 35px;
        height: 35px;
    }

    .icon-nav-label {
        font-size: 0.75rem;
        margin-top: 0;
    }

    /* Moderator settings link in navigation */
    .moderator-settings-link {
        margin-left: auto;
        color: #7a525f;
        font-weight: 600;
    }

    /* Moderator settings icon (top right) */
    .moderator-settings-icon {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 999;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(5px);
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
    }

    .moderator-settings-icon:hover {
        transform: scale(1.1);
        background: rgba(168, 148, 153, 0.1);
    }

    .moderator-settings-icon a {
        color: white;
        font-size: 1.5rem;
        text-decoration: none;
    }
    
}

/* Hide old navigation on pages with icon nav */
.has-icon-nav .nav-links {
    display: none;
    align-items: center;

}

/* Notifications Styles */
.notifications-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #a89499;
}

.unread-count {
    font-weight: 600;
    color: #7a525f;
    font-size: 1.1rem;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 0px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border-left: 4px solid #e0e0e0;
    transition: all 0.2s ease;
}

.notification-card.unread {
    background: rgba(168, 148, 153, 0.1);
    border-left-color: #a89499;
    box-shadow: 0 2px 8px rgba(168, 148, 153, 0.15);
}

.notification-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notification-message {
    color: #333;
    line-height: 0.2;
    font-size: 0.9rem;
}

.notification-time {
    color: #999;
    font-size: 0.85rem;
}

.mark-read-btn {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mark-read-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.no-notifications {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-notifications p {
    font-size: 1.2rem;
}

/* Mobile responsiveness for notifications */
@media (max-width: 768px) {
    .notifications-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .notifications-header button {
        width: 100%;
    }

    .notification-card {
        flex-direction: column;
        align-items: self-start;
        text-align: left;
    }

    .mark-read-btn {
        align-self: flex-end;
    }
}

/* ============================================
   HAMBURGER MENU & USER NAVIGATION
   ============================================ */

/* Hamburger button */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: none;
}

.hamburger-menu:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hamburger-menu:active {
    transform: scale(0.95);
}

/* Hamburger icon (three lines) */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 15px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #5a5a5a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animated hamburger when menu is open */
.hamburger-menu.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.hamburger-menu.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Slide-out menu panel */
.user-menu-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 250px !important;
    height: 70vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 80px 20px 30px;
    border-radius: 10px;
}

.user-menu-panel.active {
    right: 0;
}

/* Menu overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* User info section */
.user-menu-header {
    padding: 20px;
    border-bottom: 2px solid rgba(168, 148, 153, 0.2);
    margin-bottom: 20px;
    text-align: center;
}

.user-menu-header h3 {
    color: #7a525f;
    font-size: 1.2rem;
    margin: 10px 0 5px;
}

.user-menu-header .user-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.user-menu-header .user-icon-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid rgba(168, 148, 153, 0.3);
}

.user-menu-header .user-email {
    font-size: 0.85rem;
    color: #888;
}

/* Menu items */
.user-menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-menu-item {
    margin: 5px 0;
}

.user-menu-item a,
.user-menu-item button {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #5a5a5a;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.user-menu-item a:hover,
.user-menu-item button:hover {
    background: rgba(168, 148, 153, 0.1);
    color: #7a525f;
    transform: translateX(5px);
}

.user-menu-item .menu-icon {
    font-size: 1.5rem;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu-item .menu-label {
    flex: 1;
    font-weight: 500;
}

/* Notification badge on menu items */
.menu-badge {
    background: #ff4444;
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Logout button special styling */
.user-menu-item.logout {
    margin-top: 20px;
    border-top: 2px solid rgba(168, 148, 153, 0.2);
    padding-top: 15px;
}

.user-menu-item.logout a,
.user-menu-item.logout button {
    color: #d32f2f;
}

.user-menu-item.logout a:hover,
.user-menu-item.logout button:hover {
    background: rgba(211, 47, 47, 0.1);
    color: #b71c1c;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .user-menu-panel {
        width: 85%;
        right: -100%;
    }

    .hamburger-menu {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   USER PROFILE PAGE
   ============================================ */

.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-header {
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(168, 148, 153, 0.2);
    margin-bottom: 25px;
}

.profile-avatar {
    font-size: 5rem;
    margin-bottom: 15px;
}

.profile-avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid rgba(168, 148, 153, 0.3);
}

.profile-header h2 {
    color: #7a525f;
    font-size: 2rem;
    margin: 10px 0;
}

.profile-email {
    color: #888;
    font-size: 0.95rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 5px;
    margin-top: 25px;
}

.stat-box {
    background: linear-gradient(135deg, rgba(168, 148, 153, 0.15) 0%, rgba(122, 82, 95, 0.1) 100%);
    border-radius: 12px;
    padding: 0px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box .stat-number {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #5a5a5a;
    margin-bottom: 0px;
}

.stat-box .stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.profile-card h3 {
    color: #5a5a5a;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(168, 148, 153, 0.2);
}

.profile-form {
    margin-top: 20px;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 8px;
    color: #5a5a5a;
    font-weight: 500;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(168, 148, 153, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.profile-form input:focus {
    outline: none;
    border-color: #7a525f;
    box-shadow: 0 0 0 3px rgba(122, 82, 95, 0.1);
}

.profile-form small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

.profile-form button {
    margin-top: 10px;
}

/* Profile picture form elements */
.current-picture-preview {
    margin: 15px 0;
    text-align: center;
}

.profile-picture-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(168, 148, 153, 0.3);
    display: inline-block;
}

.help-text {
    color: #888;
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.form-group-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-group-checkbox label {
    margin: 0;
    font-weight: normal;
}

.form-file-input {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed rgba(168, 148, 153, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-file-input:hover {
    border-color: #7a525f;
    background: rgba(168, 148, 153, 0.05);
}

.account-info {
    margin-top: 15px;
}

.account-info p {
    padding: 12px 0;
    border-bottom: 1px solid rgba(168, 148, 153, 0.1);
    color: #5a5a5a;
}

.account-info p:last-child {
    border-bottom: none;
}

.account-info strong {
    color: #7a525f;
    font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .profile-card {
        padding: 20px;
    }

    .profile-avatar {
        font-size: 4rem;
    }

    .profile-header h2 {
        font-size: 1.5rem;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .stat-box {
        padding: 0px;
    }

    .stat-box .stat-number {
        font-size: 1rem;
    }
}

/* ============================================
   RESPONSIVE REFUGIUM ELEMENTS
   ============================================ */

/* Tablet and below - Scale the fixed 800×400 canvas */
@media (max-width: 768px) {
    .refugium-landscape-wrapper {
        width: 600px;   /* 800 × 0.75 */
        max-width: 100%;  /* Prevent overflow */
        width: 550px;
        height: 300px;  /* 400 × 0.75 */
    }

    .refugium-landscape {
        transform: scale(0.75);  /* Scale from center */
    }

    .refugium-container {
        padding: 20px 15px;
        min-height: 350px;
    }
}

/* Mobile - Scale the fixed 800×400 canvas further */
@media (max-width: 480px) {
    .refugium-landscape-wrapper {
        width: 285px;   /* 800 × 0.5 */
        max-width: 100%;  /* Prevent overflow */
        height: 170px;  /* 400 × 0.5 */
    }

    .refugium-landscape {
        transform: scale(0.4);  /* Scale from center */
    }

    .refugium-container {
        padding: 15px 10px;
        min-height: 200px;
    }
}

/* ============================================
   PROFILE PICTURE CROPPER MODAL
   ============================================ */

/* Clickable avatars */
.clickable-avatar {
    cursor: pointer !important;
    transition: all 0.3s ease;
}

.clickable-avatar:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Upload placeholder */
.upload-placeholder {
    width: 150px;
    height: 150px;
    border: 3px dashed rgba(168, 148, 153, 0.5);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    background: rgba(168, 148, 153, 0.05);
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    border-color: #7a525f;
    background: rgba(168, 148, 153, 0.1);
    transform: scale(1.05);
}

.upload-placeholder .upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.upload-placeholder p {
    font-size: 0.9rem;
    color: #7a525f;
    font-weight: 500;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(168, 148, 153, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: #7a525f;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(168, 148, 153, 0.1);
    color: #7a525f;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 2px solid rgba(168, 148, 153, 0.2);
}

/* Cropper container */
.cropper-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
}

#crop-canvas {
    border: 2px solid rgba(168, 148, 153, 0.3);
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Cropper controls */
.cropper-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(168, 148, 153, 0.05);
    border-radius: 10px;
}

.cropper-controls-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.zoom-control {
    flex: 1;
}

.zoom-control label {
    display: block;
    margin-bottom: 10px;
    color: #7a525f;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-replace {
    white-space: nowrap;
    flex-shrink: 0;
}

.cropper-controls label {
    display: block;
    margin-bottom: 10px;
    color: #7a525f;
    font-weight: 600;
    font-size: 0.9rem;
}

#zoom-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #7a525f;
    cursor: pointer;
}

#zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #7a525f;
    cursor: pointer;
    border: none;
}

.cropper-instructions {
    margin-top: 15px;
}

.cropper-instructions p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    text-align: center;
}

/* Cropper preview */
.cropper-preview {
    text-align: center;
    padding: 15px;
    background: rgba(168, 148, 153, 0.05);
    border-radius: 10px;
}

.cropper-preview p {
    margin: 0 0 15px 0;
    color: #7a525f;
    font-weight: 600;
}

.preview-circle {
    display: inline-block;
    background: white;
    padding: 10px;
    border-radius: 50%;
}

#preview-canvas {
    display: block;
    border-radius: 50%;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 20px 15px;
    }

    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }

    .cropper-container {
        padding: 10px;
    }

    #crop-canvas {
        max-width: 100%;
        height: auto;
    }

    .upload-placeholder {
        width: 120px;
        height: 120px;
    }

    .upload-placeholder .upload-icon {
        font-size: 2.5rem;
    }

    .cropper-controls-row {
        flex-direction: column;
        gap: 15px;
    }

    .btn-replace {
        width: 100%;
    }
}

/* ============================================
   MESSAGE CONTEXT MENU
   ============================================ */

.context-menu {
    position: absolute;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 9999;
    min-width: 320px;
    animation: contextMenuFadeIn 0.2s ease;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Emoji row */
.context-menu-emojis {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.emoji-btn,
.emoji-more-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-btn:hover,
.emoji-more-btn:hover {
    background: rgba(168, 148, 153, 0.1);
    transform: scale(1.15);
}

.emoji-btn:active,
.emoji-more-btn:active {
    transform: scale(0.95);
}

.emoji-more-btn {
    font-size: 1.5rem;
    color: #7a525f;
}

/* Divider */
.context-menu-divider {
    height: 1px;
    background: rgba(168, 148, 153, 0.2);
    margin: 8px 0;
}

/* Reply button */
.context-reply-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #5a5a5a;
    transition: background 0.2s ease;
}

.context-reply-btn:hover {
    background: rgba(168, 148, 153, 0.1);
}

.context-reply-btn .reply-icon {
    width: 16px;
    height: 16px;
    color: #7a525f;
}

/* Hide old reaction and reply buttons - replaced by context menu */
.activity-item .activity-comment .reactions,
.activity-item .activity-exercise .reactions,
.activity-item .activity-comment .reply-btn, {
    display: none !important;
}


/* Make messages clickable */
.activity-comment,
.activity-exercise {
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 12px;
    margin: -12px;
    border-radius: 8px;
}

/* Highlight parent comment only when not hovering over nested replies */
.activity-comment:hover:not(:has(.reply-item:hover)),
.activity-exercise:hover {
    background: rgba(168, 148, 153, 0.05);
}

/* Mobile optimization */
@media (max-width: 768px) {
    .context-menu {
        min-width: 280px;
        left: 50% !important;
        transform: translateX(-50%);
    }

    .emoji-btn,
    .emoji-more-btn {
        width: 32px;
        height: 32px;
        font-size: 1.5rem;
    }

    .context-menu-emojis {
        gap: 6px;
    }
}

/* Email Verification Styles */
.email-verified {
    color: #28a745;
    font-weight: bold;
    margin-left: 5px;
}

.email-unverified {
    color: #ffc107;
    font-weight: bold;
    margin-left: 5px;
}

.pending-email {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 4px;
    color: #856404;
}

.pending-email strong {
    color: #664d03;
}

.resend-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.resend-link:hover {
    color: #004499;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
}

.email-warning {
    color: #856404;
}

.email-warning a {
    color: #0066cc;
    text-decoration: underline;
}

.email-info {
    color: #666;
}

/* Form help text styling */
.form-help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.field-error {
    color: #dc3545;
    font-size: 0.9rem;
}

/* Form row for side-by-side fields */
.form-row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.form-row .form-group {
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* ==========================================
   Django Messages Framework Styling
   ========================================== */

.messages-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 600px;
    pointer-events: none;
}

.message {
    background-color: #fff;
    border-left: 5px solid;
    padding: 16px 50px 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideInDown 0.3s ease-out;
    position: relative;
}

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

.message-error {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.message-success {
    border-left-color: #28a745;
    background-color: #f0fff4;
}

.message-info {
    border-left-color: #17a2b8;
    background-color: #f0f9ff;
}

.message-warning {
    border-left-color: #ffc107;
    background-color: #fffbf0;
}

.message-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.message-text {
    flex-grow: 1;
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

.message-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.message-close:hover {
    color: #333;
}

/* Auto-dismiss messages after 7 seconds */
.message {
    animation: slideInDown 0.3s ease-out, fadeOut 0.5s ease-out 6.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}
