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

body {
    min-height: 100svh;
    background-color: #1a1a1a;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(0.7rem, 2.5vh, 1rem);
    color: #ffffff;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    touch-action: pan-y; /* For swipe compatibility */
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loading-screen img {
    width: 70%;
    max-width: 400px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
  

  #main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
    display: block; /* ← Make sure it's not hidden */
    width: 100%;     /* ← Ensure it takes full width */
}
#main-content.visible {
    opacity: 1;
}


/* Layout Containers */
.container {
    background-color: #1a1a1a;
    border-radius: clamp(15px, 5vh, 25px);
    margin: clamp(5px, 1vh, 10px) 0;
    padding: clamp(5px, 2vh, 10px);
    width: 100%;
    height: clamp(75svh, 80svh, 85svh);
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    touch-action: none;
}

.exercise-wrapper {
    position: relative;
    overflow: hidden;
    top: 20vh;
    min-height: clamp(40vh, 50vh, 60vh);
    flex-grow: 1;
    width: 100%;
}

.faq-container {
    width: 100%;
    padding: clamp(0.5rem, 2vh, 1rem) clamp(0.5rem, 2vh, 1rem);
    color: #ffffff;
    margin-top: clamp(0.5rem, 2vh, 1rem);
}

.faq-page .container {
    overflow-y: hidden;
}

.faq-page .faq-container {
    overflow-y: auto;
    max-height: calc(clamp(85svh, 90svh, 95svh) - clamp(8rem, 20vh, 10rem));
}

.profile-container {
    width: 100%;
    padding: clamp(0.5rem, 2vh, 1rem);
    flex-grow: 1;
    border: #cccccc;
    border-width: .2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Shared Elements */
.user-status {
    position: fixed;
    top: clamp(1rem, 2vh, 2rem);
    right: clamp(1rem, 2vh, 2rem);
    z-index: 11;
}

.user-avatar {
    width: clamp(2rem, 5vh, 3rem);
    height: clamp(2rem, 5vh, 3rem);
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: clamp(0.1rem, 0.5vh, 0.2rem) solid #D15050;
}

.logo {
    position: fixed;
    top: clamp(0.5rem, 4vh, 3rem);
    left: clamp(0.5rem, 5vh, 3rem);
    z-index: 10;
    margin: vh;
}

.logo img {
    max-height: clamp(30px, 8vh, 150px);
    max-width: 65vw;
    display: block;
    margin: 0 auto;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.copyright {
    position: fixed;
    bottom: clamp(0.2rem, 1vh, 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.5rem, 1.5vh, 0.75rem);
    color: #4d4d4d;
    z-index: 5;
}

.help-button {
    width: clamp(1.5rem, 4vh, 2.5rem);
    height: clamp(1.5rem, 4vh, 2.5rem);
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.help-button:hover {
    opacity: 0.8;
}

.utility-buttons {
    position: fixed;
    bottom: clamp(1rem, 3vh, 2rem);
    right: clamp(1rem, 3vh, 2rem);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.widget-button {
    width: clamp(1.5rem, 4vh, 2.5rem);
    height: clamp(1.5rem, 4vh, 2.5rem);
    background: rgba(237, 198, 81, 0.1);
    border: 2px solid #edc651;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #edc651;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.widget-button:hover {
    background: rgba(237, 198, 81, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 198, 81, 0.3);
}

.widget-button svg {
    width: 16px;
    height: 16px;
}

.helpLogo {
    max-width: 50%;
    margin: 1.5rem;
}

.profile-logo {
    max-height: clamp(30px, 6vh, 50px);
    max-width: 65vw;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 700;
    margin: clamp(0.2rem, 1vh, 0.4rem) 0;
    text-align: center;
}

h1 {
    font-size: clamp(0.8rem, 6vh, 6rem);
    color: #edc651;
}

.long-text {
    font-size: clamp(1rem, 8vw, 5rem) !important;
}

#dailyExerciseName, #weeklyExerciseName, #feastExerciseName, #customExerciseName {
    max-width: 100%;
    cursor: pointer;
    font-size: clamp(1rem, 11vw, 9rem);
}

h1.faq-header {
    font-size: clamp(1.5rem, 5vh, 2rem);
    color: #edc651;
    margin-bottom: clamp(1rem, 4vh, 2rem);
}

h2 {
    font-size: clamp(1.2rem, 5vh, 2rem);
    color: #edc651;
}

h3 {
    font-size: clamp(1rem, 4vh, 1.5rem);
    color: #D15050;
    margin: clamp(0.5rem, 2vh, 1rem) 0;
}

h4 {
    font-size: clamp(0.8rem, 3vh, 1.2rem);
    color: #cccccc;
}

p {
    font-size: clamp(0.8rem, 2.5vh, 1rem);
    color: #cccccc;
    margin: clamp(0.1rem, 0.5vh, 0.2rem) clamp(0.3rem, 1vh, 0.5rem);
    text-align: center;
    line-height: 1.5;
}

.countdown, .next-exercise, .progress {
    font-weight: 700;
    color: #cccccc;
}

.countdown {
    font-size: clamp(0.8rem, 3vh, 2rem);
    margin: clamp(0.4rem, 1.5vh, 0.6rem) 0 clamp(0.6rem, 2vh, 0.8rem);
}

.next-exercise {
    font-size: clamp(0.6rem, 2vh, 2rem);
    padding: clamp(0.5rem, 4vh, 4rem) clamp(0.3rem, 2vh, 4rem);
    margin-top: clamp(0.2rem, 1vh, 2rem);
}

.progress {
    font-size: clamp(0.8rem, 6vh, 6rem);
    margin-bottom: clamp(0.2rem, 1vh, 1rem);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.progress-count {
    color: #D15050;
}

.progress-goal {
    color: #37A7b3;
}

/* Streak Info in XP Box */
.streak-info-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #9aa3b2;
}

.streak-info-bottom #dailyStreakLeft {
    display: flex;
    align-items: center;
    gap: 4px;
}

.streak-info-bottom #dailyMultiplierRight {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Streak milestone animations */
@keyframes streakPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.streak-milestone {
    animation: streakPulse 0.6s ease-in-out;
}

/* Profile Mockup */
.profile-mockup {
    max-width: 100%;
    max-height: clamp(40vh, 60vh, 80vh);
    object-fit: contain;
}

/* FAQ-Specific Styles */
details {
    margin-bottom: clamp(0.5rem, 2vh, 1rem);
    background-color: #1a1a1a;
    border-radius: clamp(0.3rem, 1vh, 0.5rem);
    padding: clamp(0.3rem, 1vh, 0.5rem);
    box-shadow: 0 clamp(0.2rem, 1vh, 0.375rem) clamp(0.2rem, 1vh, 0.375rem) rgba(0, 0, 0, 0.2);
    width: 100%;
    display: block;
}

summary {
    font-size: clamp(0.9rem, 2.5vh, 1.6rem);
    font-weight: 700;
    cursor: pointer;
    padding: clamp(0.3rem, 1vh, 0.5rem);
    color: #ffffff;
    width: 100%;
    display: block;
    transition: color 0.3s ease;
}

summary:hover {
    color: #edc651;
}

details[open] summary {
    color: #edc651;
}

/* Inline Text Styles */
r { color: #D15050; font-weight: 700; }
y { color: #edc651; font-weight: 700; }
bl { color: #37A7b3; font-weight: 700; }
gr { color: #6dbb53; }
or { color: #f4b261; }
pu { color: #8e5ab0; }

/* Slider Styles */
.toggle-slider {
    position: fixed;
    bottom: clamp(2rem, 10vh, 10rem);
    left: 50%;
    transform: translateX(-50%);
    width: clamp(75px, 27rem, 90vw);
    height: clamp(30px, 5vh, 8vh);
    background-color: #02222b;
    border-radius: clamp(10px, 3vh, 15px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    cursor: pointer;
    user-select: none;
    z-index: 10;
}

.slider-option {
    width: 50%;
    height: 100%;
    line-height: clamp(30px, 5vh, 8vh);
    text-align: center;
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 400;
    font-size: clamp(10px, 1.5vh, 3rem);
    color: #ffffff;
    transform: translateY(-7%);
    opacity: 0.5;
    z-index: 2;
    transition: font-size 0.3s ease, font-weight 0.3s ease, opacity 0.3s ease, color 0.3s ease;
}

.slider-option.active {
    opacity: 1;
    color: #ffffff;
    font-weight: 700;
}

#friendsSlide.active,
#dailySlide.active,
#weeklySlide.active {
    color: #ffffff;
}

#friendsSlide:not(.active) {
    color: #ffffff;
}

.slider-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    border-radius: clamp(8px, 2vh, 10px);
    transition: left 0.3s ease, background-color 0.3s ease;
    z-index: 1;
}

.slider-bg.friends {
    background-color: #8e5ab0;
    left: 0;
}

.slider-bg.daily {
    background-color: #edc651;
    left: 0;
}

.slider-bg.weekly {
    background-color: #37A7b3;
    left: 50%;
}

#friendsContent {
    transform: translateX(-200%);
    height: calc(100vh - clamp(16rem, 25vh, 20rem));
    overflow: visible;
    display: flex;
    flex-direction: column;
}

#friendsContent.active {
    transform: translateX(0);
}

#friendsContent h4 {
    margin: clamp(0.1rem, 0.3vh, 0.3rem) 0;
    font-size: clamp(0.8rem, 1.5vh, 1rem);
    color: #edc651;
}

/* Sliding Content */
#dailyContent, #weeklyContent {
    position: absolute;
    top: 0;
    width: 100%;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

#dailyContent:not(.active),
#weeklyContent:not(.active) {
    display: none;
}

#dailyContent.active,
#weeklyContent.active {
    display: block;
    transform: translateX(0);
    opacity: 1;
}

#dailyContent {
    transform: translateX(0);
}

#weeklyContent {
    transform: translateX(200%);
}



#feastModeDefine {
    font-weight: 400;
    font-style: italic;
}

/* Signifiers */
.active-page-signifier {
    text-align: center;
    font-size: clamp(12px, 3vh, 14px);
    font-weight: 700;
    margin: clamp(3px, 1.5vh, 5px) 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    position: relative;
    z-index: 10;
}

#dailySignifier {
    color: #37A7b3;
}

#weeklySignifier {
    color: #edc651;
}

#feastSignifier {
    color: #D15050;
}

#dailySignifier.active, #weeklySignifier.active, #feastSignifier.active {
    opacity: 1;
}

/* Components */
.progress-bar {
    width: 100%;
    max-width: clamp(200px, 60vw, 250px);
    height: clamp(12px, 2.5vh, 25px); 
    background-color: #37A7b3 !important; /* Blue background */
    border-radius: clamp(0.2rem, 1vh, 0.3rem);
    margin: clamp(0.1rem, 1vh, 0.6rem) auto;
    overflow: hidden;
    min-height: 12px;
}

.progress-fill {
    height: 100%;
    background-color: #D15050 !important; /* Red fill for current reps */
    transition: width 0.3s ease-in-out;
    min-width: 2px; /* Ensure visibility even with minimal progress */
}

/* Friend progress bars */
.friend-progress {
    margin-top: 8px;
}

.friend-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
    max-width: none;
}

.friend-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.friend-progress-fill.daily {
    background: #edc651; /* Yellow for Graze */
}

.friend-progress-fill.weekly {
    background: #D15050; /* Red for Elephant */
}

/* Delete friend button removed - no longer needed */

.confirm-delete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

.confirm-delete-content {
    background-color: #02222b;
    color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.confirm-delete-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.confirm-delete-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.confirm-delete-buttons .confirm {
    background-color: #D15050;
    color: white;
}

.confirm-delete-buttons .cancel {
    background-color: #666;
    color: white;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: clamp(0.1rem, 1vh, 0.2rem);
    flex-wrap: wrap;
    margin-top: clamp(0.5rem, 2vh, 1rem);
    margin-bottom: clamp(0.5rem, 2vh, 1rem);
}

button {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(0.8rem, 2.5vh, 1rem);
    font-weight: 900;
    flex: 1 1 20%;
    border-radius: 10%;
    background-color: #edc651;
    color: #02222b;
    height: clamp(2.5rem, 8vh, 3rem);
    min-width: clamp(2.5rem, 10vw, 3.5rem);
    border: none;
}

#dailyExerciseControls button, #weeklyExerciseControls button, #customExerciseControls button {
    max-width: clamp(3.5rem, 12vw, 4.5rem);
}

/* Countdown Label */
.countdown-label {
    font-size: clamp(12px, 2vh, 16px);
    color: #ffffff;
    text-align: center;
    margin-bottom: 5px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    font-size: clamp(1rem, 2vh, 3rem);
}

.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #02222b;
    color: #ffffff;
    border: 1px solid #edc651;
    border-radius: clamp(0.5rem, 2vh, 1rem);
    padding: clamp(1.5rem, 3vh, 2.5rem);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #edc651;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-content p {
    margin: 1rem 0;
    color: var(--text-color);
}

.modal-content label {
    display: block;
    margin: 0.5rem 0;
    color: var(--text-color);
    font-weight: 500;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #edc651;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ffffff;
}

.instructions-content {
    margin-top: 1rem;
    line-height: 1.6;
    text-align: left;
}

.instructions-content ol,
.instructions-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.instructions-content li {
    margin: 0.5rem 0;
}

.instructions-content ol li {
    margin: 0.8rem 0;
    line-height: 1.4;
}

.instructions-content ul li {
    margin: 0.6rem 0;
    line-height: 1.4;
}

/* Exercise name hover effects */
#weeklyExerciseName:hover,
#dailyExerciseName:hover {
    color: #edc651;
    text-decoration: underline;
}

.styled-input {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.styled-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

textarea.styled-input {
    height: 100px;
    resize: vertical;
}

#submitFeedbackBtn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    transition: all 0.3s ease-in-out;
}

#submitFeedbackBtn:hover {
    background-color: #0056b3;
}

#feastRepsModal .modal-content {
    background-color: #02222b;
    color: #ffffff;
    padding: clamp(0.5rem, 2vh, 1rem);
    border-radius: clamp(0.5rem, 2vh, 1rem);
    max-width: clamp(15rem, 75vw, 18rem);
    box-shadow: 0 clamp(0.2rem, 1vh, 0.375rem) clamp(0.2rem, 1vh, 0.375rem) rgba(0, 0, 0, 0.2);
    font-family: 'Roboto', Arial, sans-serif;
    text-align: center;
}

#feastRepsModal h2 {
    margin: 0 0 10px;
}

#feastRepsModal input[type="number"] {
    background-color: #ffffff;
    color: #02222b;
    border: none;
    padding: 5px;
    border-radius: 5px;
}

#feastRepsModal button {
    background-color: #D15050;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

#feastRepsModal button:hover {
    background-color: #D15050;
}

.auth-modal-close, .instructions-modal-close {
    color: #aaa;
    float: right;
    font-size: clamp(1.2rem, 3vh, 1.5rem);
    font-weight: bold;
    cursor: pointer;
}

.auth-modal-close:hover, .instructions-modal-close:hover {
    color: #fff;
}

.instructions-modal-content {
    text-align: left;
    padding: clamp(1rem, 3vh, 1.5rem);
}

.instructions-modal-content ul, .instructions-modal-content ol {
    margin: clamp(0.5rem, 2vh, 1rem) 0;
    padding-left: clamp(1rem, 4vw, 1.5rem);
    color: #cccccc;
}

.instructions-modal-content li {
    margin: clamp(0.3rem, 1vh, 0.5rem) 0;
    line-height: 1.5;
}

.help-modal {
    display: none;
    position: absolute;
    z-index: 1002;
}

.help-modal-content {
    background-color: #02222b;
    color: #ffffff;
    padding: clamp(0.5rem, 2vh, 1rem);
    border-radius: clamp(0.5rem, 2vh, 1rem);
    box-shadow: 0 clamp(0.2rem, 1vh, 0.375rem) clamp(0.2rem, 1vh, 0.375rem) rgba(0, 0, 0, 0.2);
    font-family: 'Roboto', Arial, sans-serif;
    text-align: center;
    width: clamp(10rem, 50vw, 15rem);
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.help-modal-content p {
    margin-bottom: clamp(0.5rem, 2vh, 1rem);
}

.help-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.8rem, 2vh, 1rem);
}

.help-prev, .help-next, .help-close {
    cursor: pointer;
    color: #edc651;
    padding: clamp(0.2rem, 1vh, 0.5rem);
}

.help-prev:hover, .help-next:hover, .help-close:hover {
    color: #edc651;
}

.help-prev[data-step="1"], .help-next[data-step="4"] {
    opacity: 0.5;
    cursor: default;
}

.submenu-modal {
    display: none;
    position: absolute;
    background-color: #02222b;
    color: #ffffff;
    border-radius: clamp(0.3rem, 1vh, 0.5rem);
    box-shadow: 0 clamp(0.2rem, 1vh, 0.375rem) clamp(0.2rem, 1vh, 0.375rem) rgba(0, 0, 0, 0.2);
    z-index: 1002;
    padding: clamp(0.5rem, 1.5vh, 0.8rem) 0;
    min-width: clamp(120px, 30vw, 180px);
    max-width: calc(100vw - clamp(3rem, 5vh, 6rem));
    right: 0;
}

.greeting {
    padding: clamp(0.5rem, 1.5vh, 0.8rem) clamp(0.8rem, 2.5vh, 1.2rem);
    color: #edc651;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(1rem, 2.5vh, 1.3rem);
    font-weight: 600;
    border-bottom: 1px solid #edc651;
    margin-bottom: clamp(0.5rem, 1.5vh, 0.8rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.submenu-modal[style*="display: block"] {
    display: block;
}

.submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.submenu-list a {
    display: block;
    padding: clamp(0.5rem, 1.5vh, 0.8rem) clamp(0.8rem, 2.5vh, 1.2rem);
    color: #ffffff;
    text-decoration: none;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: clamp(1rem, 2.5vh, 1.3rem);
    font-weight: 500;
}

.submenu-list a:hover {
    background-color: #edc651;
    color: #02222b;
    border-radius: clamp(0.2rem, 0.5vh, 0.25rem);
}

/* Calendar */
.calendar-container {
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.calendar-table {
    width: 100%;
    max-width: 90%;
    border-collapse: collapse;
    margin: clamp(0.5rem, 2vh, 1rem) auto;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    table-layout: fixed;
}

.calendar-table th, .calendar-table td {
    border: 1px solid #ddd;
    padding: clamp(0.3rem, 1vh, 0.8rem);
    font-size: clamp(0.7rem, 1vw, 1rem);
    text-align: center;
    vertical-align: top;
    min-width: 50px;
    max-width: 150px;
    word-wrap: break-word;
}

.calendar-table th {
    background-color: #444;
    color: white;
    padding: clamp(0.5rem, 1vh, 1rem);
}

.weekly-row td {
    background-color: #333;
    font-weight: bold;
}

/* Flatpickr Custom Styles */
.flatpickr-calendar {
    background: #2a2a2a !important;
    border: 1px solid #02222b !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

.flatpickr-months {
    background: #02222b !important;
    color: #edc651 !important;
    border-radius: 10px 10px 0 0 !important;
}

.flatpickr-current-month {
    color: #edc651 !important;
}

.flatpickr-current-month input {
    color: #edc651 !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: #edc651 !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: #444 !important;
    border-radius: 50% !important;
}

.flatpickr-weekdays {
    background: #1a1a1a !important;
    color: #edc651 !important;
}

.flatpickr-weekday {
    color: #edc651 !important;
}

.flatpickr-day {
    color: #ffffff !important;
    border-radius: 5px !important;
    transition: all 0.2s ease-in-out !important;
}

.flatpickr-day:hover {
    background: #555 !important;
    color: #edc651 !important;
}

.flatpickr-day.selected {
    background: #edc651 !important;
    color: #1a1a1a !important;
    font-weight: bold !important;
}

.flatpickr-day.today {
    border: 1px solid #edc651 !important;
    color: #edc651 !important;
    font-weight: bold !important;
}

.flatpickr-day.flatpickr-disabled {
    color: #525252 !important;
    cursor: not-allowed !important;
}

.flatpickr-time {
    background: #02222b !important;
    color: #ffffff !important;
    border-top: 1px solid #444 !important;
}

.flatpickr-time input {
    color: #ffffff !important;
}

.flatpickr-time .flatpickr-am-pm {
    background: #444 !important;
    color: #edc651 !important;
}

.flatpickr-input {
    background: #222 !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
    border-radius: 5px !important;
    padding: 8px !important;
    font-size: 1rem !important;
}

.flatpickr-input:focus {
    border-color: #edc651 !important;
    box-shadow: 0 0 5px rgba(237, 198, 81, 0.5) !important;
}

@media (max-width: 768px) {
    .flatpickr-calendar {
        width: 100% !important;
    }
}

/* General styling for text inputs */
.styled-input {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.styled-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

label[for="exerciseName"] {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

/* General dropdown styling */
.styled-dropdown {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease-in-out;
    background-color: #222;
    color: #fff;
    border: 2px solid #555;
}

.styled-dropdown:hover {
    border-color: #007BFF;
}

.styled-dropdown:focus {
    border-color: #00AEEF;
    box-shadow: 0 0 5px rgba(0, 174, 239, 0.5);
}

.styled-dropdown option {
    padding: 10px;
    font-size: 16px;
}

label[for="exerciseType"] {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Description Text */
.modal-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

/* Labels */
.modal-content label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    margin: 10px 0 5px;
    color: #444;
}

/* Input & Select Box Styles */
.gender-select,
.age-input,
.experience-select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    color: #333;
    outline: none;
    transition: border-color 0.3s ease-in-out;
}

/* Focus Effect */
.gender-select:focus,
.age-input:focus,
.experience-select:focus {
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Save Button */
#saveSettingsBtn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    transition: all 0.3s ease-in-out;
}

/* Save Button Hover */
#saveSettingsBtn:hover {
    background-color: #0056b3;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button for Instructions Modal */
.instructions-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: color 0.3s;
}

.instructions-modal-close:hover {
    color: #000;
}

/* Groups Row Styles */
.groups-row {
    display: flex;
    gap: 1.2rem;
    margin: 1rem 0 3rem 0;
    padding: 2rem 0.8rem 3rem 0.8rem;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scrollbar-width: thin;
    scrollbar-color: #edc651 #333;
    min-height: 160px;
    /* Prevent touch scrolling from interfering with page navigation */
    touch-action: pan-x;
}

/* Custom Webkit Scrollbar for Groups Row */
.groups-row::-webkit-scrollbar {
    height: 8px;
}

.groups-row::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.groups-row::-webkit-scrollbar-thumb {
    background: #edc651;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.groups-row::-webkit-scrollbar-thumb:hover {
    background: #d4b13d;
}

.groups-row::-webkit-scrollbar-corner {
    background: #333;
}

.group-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 105px;
    text-align: center;
    background-color: transparent !important;
    border: none !important;
}

.group-icon:hover {
    background-color: transparent !important;
    transform: translateY(-2px);
}

.group-icon:hover .group-icon-placeholder,
.group-icon:hover img {
    transform: scale(1.05);
}

.group-icon.active {
    transform: translateY(-2px);
    background-color: transparent !important;
    border: none !important;
}

.group-icon.active .group-icon-placeholder {
    border: 2px solid #edc651;
    box-shadow: 0 0 10px rgba(237, 198, 81, 0.5);
}

.group-icon.active img {
    border: 2px solid #edc651;
    box-shadow: 0 0 10px rgba(237, 198, 81, 0.5);
}

.group-icon.active .group-name {
    color: #edc651;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.group-icon-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    border: 2px solid #555;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.all-friends-icon {
    font-size: 1.2rem !important;
    font-weight: bold;
    letter-spacing: 1px;
}

.group-icon img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #555;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.group-name {
    font-size: 0.9rem;
    color: #ccc;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Add Group Button Styling */
.add-group-btn {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.add-group-btn:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
}

.add-group-icon {
    border: 2px dashed #666 !important;
    background-color: rgba(102, 102, 102, 0.1) !important;
    color: #999;
    font-size: 3rem !important;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-group-btn:hover .add-group-icon {
    border-color: #edc651 !important;
    background-color: rgba(237, 198, 81, 0.1) !important;
    color: #edc651;
    transform: rotate(90deg);
}

.add-group-btn .group-name {
    color: #999;
    font-weight: 400;
}

.add-group-btn:hover .group-name {
    color: #edc651;
}

/* Current User Styling */
.friend-box.current-user {
    border: 2px solid #edc651;
    background: linear-gradient(135deg, rgba(237, 198, 81, 0.1) 0%, rgba(237, 198, 81, 0.05) 100%);
    position: relative;
}

.friend-box.current-user::before {
    content: '👤';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #edc651;
    color: #02222b;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.friend-box.current-user .friend-name {
    color: #edc651;
    font-weight: 600;
}

/* Removed old friends-grid definition that used minmax layout system */

.friend-box {
    background: linear-gradient(135deg, rgba(55, 167, 179, 0.1) 0%, rgba(55, 167, 179, 0.05) 100%);
    border: 2px solid rgba(237, 198, 81, 0.3);
    border-radius: 16px;
    padding: clamp(1rem, 2vh, 1.5rem);
    box-sizing: border-box;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.friend-box:hover {
    border-color: rgba(237, 198, 81, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.friend-header {
    display: flex;
    align-items: center;
    margin-bottom: clamp(0.75rem, 2vh, 1rem);
    gap: clamp(0.5rem, 1vh, 0.75rem);
}



.friend-name {
    font-size: clamp(1.1rem, 2.5vh, 1.4rem);
    font-weight: 700;
    color: #edc651;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.friend-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1vh, 0.75rem);
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.progress-label {
    display: none; /* Hide progress labels */
}

.progress-percentage {
    display: none; /* Hide percentage numbers */
}

.friend-progress-bar {
    width: 100%;
    height: clamp(8px, 1.5vh, 12px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.friend-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    position: relative;
    border-radius: 6px;
}

.friend-progress-fill.daily {
    background: linear-gradient(90deg, #edc651 0%, #f4b261 100%); /* Yellow for Graze */
    box-shadow: 0 0 8px rgba(237, 198, 81, 0.3);
}

.friend-progress-fill.weekly {
    background: linear-gradient(90deg, #D15050 0%, #e74c3c 100%); /* Red for Elephant */
    box-shadow: 0 0 8px rgba(209, 80, 80, 0.3);
}

/* Delete friend button removed - no longer needed */

.no-progress-message {
    text-align: center;
    color: rgba(237, 198, 81, 0.7);
    font-style: italic;
    padding: clamp(0.75rem, 1.5vh, 1rem);
    margin: clamp(0.5rem, 1vh, 0.75rem) 0;
    font-size: clamp(0.8rem, 1.5vh, 0.9rem);
    background: rgba(237, 198, 81, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(237, 198, 81, 0.3);
}

/* Responsive adjustments - removed conflicting friends-grid rules that interfered with avatar layout */

/* Removed conflicting 1200px friends-grid rule for old layout system */

.connect-friends-btn {
    background-color: #edc651;
    color: #02222b;
    font-size: clamp(0.8rem, 1.8vh, 1rem);
    padding: clamp(0.3rem, 0.7vh, 0.5rem) clamp(0.8rem, 1.2vh, 1rem);
    border-radius: clamp(0.3rem, 1vh, 0.5rem);
    border: none;
    cursor: pointer;
    margin: 0.2rem auto 0.4rem;
    font-weight: 600;
    transition: all 0.3s ease;
    max-width: 65%;
    display: block;
    height: auto !important;
    line-height: 1.2;
    min-height: auto !important;
    flex: none !important;
}

.connect-friends-btn:hover {
    background-color: #d4b13d;
    transform: scale(1.05);
}

.friends-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.friends-buttons .connect-friends-btn {
    margin: 0;
    max-width: none;
    flex: 1;
    min-width: 140px;
}

@media (max-width: 768px) {
    .friends-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .friends-buttons .connect-friends-btn {
        min-width: auto;
    }
}

/* Group Icon Upload Styles */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.image-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed #666;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.image-preview:hover {
    border-color: #4CAF50;
    background: #333;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #888;
    text-align: center;
}

.upload-icon {
    font-size: 2rem;
    opacity: 0.7;
}

.upload-text {
    font-size: 0.8rem;
    max-width: 80px;
    line-height: 1.2;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.btn-upload {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-upload:hover {
    background: #45a049;
}

.btn-remove-image {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-remove-image:hover {
    background: #d32f2f;
}

/* Group Icon Display Styles */
.group-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4CAF50;
}

.group-icon-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #4CAF50;
}

.group-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #4CAF50;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.group-header-info {
    flex: 1;
}

.group-header-info h2 {
    margin: 0 0 0.5rem 0;
    color: #fff;
}

.group-header-info .group-description {
    margin: 0;
    color: #ccc;
    font-size: 0.9rem;
}

.friend-code-section,
.add-friend-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.friend-code-instructions {
    color: #edc651 !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
}

/* Override modal-content p for friend code section */
.friend-code-section p:not(.friend-code-instructions) {
    color: #ffffff;
    margin: 0.5rem 0;
}

.friend-code-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

#userFriendCode {
    font-family: monospace;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    letter-spacing: 1px;
}

.copy-button,
.add-button {
    padding: 0.5rem 1rem;
    background: #edc651;
    border: none;
    border-radius: 4px;
    color: #02222b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.copy-button:hover,
.add-button:hover {
    background: #d4b13d;
    transform: scale(1.05);
}

.friend-code-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#friendCodeInput {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
}

.message {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.message.error {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.no-friends-message {
    text-align: center;
    padding: 2rem;
    color: #edc651;
    font-style: italic;
    width: 100%;
}

.no-friends-message p {
    margin: 0;
    font-size: 1.1rem;
}

/* Override slider option width for visible options only */
.toggle-slider {
    display: flex;
    justify-content: space-between;
}

.slider-option[style*="display: none"] {
    display: none !important;
}

/* QR Code Styles */
.qr-code-section {
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid #333;
}

.qr-code-section h3 {
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    margin-bottom: 0.5rem;
}

.qr-code-image {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.qr-loading {
    color: #888;
    font-style: italic;
}

.qr-error {
    color: #D15050;
    font-style: italic;
}

.download-button {
    background-color: #37A7b3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.download-button:hover {
    background-color: #2d8a94;
}

.download-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* Modern Typography and Spacing for Friend Panel */
:root {
    --friend-spacing-xs: clamp(0.25rem, 0.5vh, 0.5rem);
    --friend-spacing-sm: clamp(0.5rem, 1vh, 0.75rem);
    --friend-spacing-md: clamp(0.75rem, 1.5vh, 1rem);
    --friend-spacing-lg: clamp(1rem, 2vh, 1.5rem);
    --friend-spacing-xl: clamp(1.5rem, 3vh, 2rem);
    
    --friend-font-xs: clamp(0.7rem, 1.2vh, 0.8rem);
    --friend-font-sm: clamp(0.8rem, 1.5vh, 0.9rem);
    --friend-font-md: clamp(1rem, 2vh, 1.2rem);
    --friend-font-lg: clamp(1.2rem, 2.5vh, 1.4rem);
    --friend-font-xl: clamp(1.4rem, 3vh, 1.6rem);
    
    --friend-line-height-tight: 1.2;
    --friend-line-height-normal: 1.4;
    --friend-line-height-relaxed: 1.6;
    
    --friend-border-radius-sm: 6px;
    --friend-border-radius-md: 12px;
    --friend-border-radius-lg: 16px;
    
    --friend-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --friend-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.2);
    --friend-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 130px);
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
    max-height: calc(100% - clamp(8rem, 15vh, 12rem));
    margin-top: var(--friend-spacing-md);
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

/* Mobile Phones (up to 480px) */
@media (max-width: 480px) {
    .friends-grid {
        grid-template-columns: repeat(auto-fill, 85px);
        gap: 8px;
        padding: 10px;
    }
    
    .friend-avatar-container {
        width: 85px !important;
        height: 85px !important;
    }
    
    .progress-ring-outer {
        width: 85px !important;
        height: 85px !important;
    }
    
    .progress-ring-inner {
        width: 75px !important;
        height: 75px !important;
    }
    
    .friend-avatar {
        width: 65px !important;
        height: 65px !important;
        font-size: 14px !important;
        max-width: 65px !important;
        max-height: 65px !important;
        overflow: hidden !important;
    }
    
    /* Groups responsive styling */
    .groups-row {
        gap: 0.6rem;
        padding: 1.5rem 0.5rem 2.5rem 0.5rem;
        min-height: 130px;
    }
    
    .group-icon {
        min-width: 75px;
        padding: 0.3rem;
        gap: 0.3rem;
    }
    
    .group-icon-placeholder,
    .group-icon img {
        width: 65px;
        height: 65px;
    }
    
    .all-friends-icon {
        font-size: 0.9rem !important;
    }
    
    .group-name {
        font-size: 0.75rem;
        max-width: 75px;
    }
}

/* Large Phones / Small Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .friends-grid {
        grid-template-columns: repeat(auto-fill, 105px);
        gap: 10px;
        padding: 12px;
    }
    
    .friend-avatar-container {
        width: 105px !important;
        height: 105px !important;
    }
    
    .progress-ring-outer {
        width: 105px !important;
        height: 105px !important;
    }
    
    .progress-ring-inner {
        width: 95px !important;
        height: 95px !important;
    }
    
    .friend-avatar {
        width: 85px !important;
        height: 85px !important;
        font-size: 16px !important;
        max-width: 85px !important;
        max-height: 85px !important;
        overflow: hidden !important;
    }
    
    /* Groups responsive styling */
    .groups-row {
        gap: 0.8rem;
        padding: 1.6rem 0.6rem 2.6rem 0.6rem;
        min-height: 140px;
    }
    
    .group-icon {
        min-width: 85px;
        padding: 0.4rem;
        gap: 0.4rem;
    }
    
    .group-icon-placeholder,
    .group-icon img {
        width: 75px;
        height: 75px;
    }
    
    .all-friends-icon {
        font-size: 1rem !important;
    }
    
    .group-name {
        font-size: 0.8rem;
        max-width: 85px;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .friends-grid {
        grid-template-columns: repeat(auto-fill, 130px);
        gap: 10px;
        padding: 16px;
    }
    
    .friend-avatar-container {
        width: 130px;
        height: 130px;
    }
    
    .progress-ring-outer {
        width: 130px !important;
        height: 130px !important;
    }
    
    .progress-ring-inner {
        width: 120px !important;
        height: 120px !important;
    }
    
    .friend-avatar {
        width: 106px !important;
        height: 106px !important;
        font-size: 20px !important;
    }
    
    /* Groups responsive styling */
    .groups-row {
        gap: 1.2rem;
        padding: 2rem 0.8rem 3rem 0.8rem;
        min-height: 160px;
    }
    
    .group-icon {
        min-width: 105px;
        padding: 0.6rem;
        gap: 0.6rem;
    }
    
    .group-icon-placeholder,
    .group-icon img {
        width: 96px;
        height: 96px;
    }
    
    .all-friends-icon {
        font-size: 1.1rem !important;
    }
    
    .group-name {
        font-size: 0.9rem;
        max-width: 105px;
    }
}

/* Large Tablets and up (1025px+) */
@media (min-width: 1025px) {
    .friends-grid {
        grid-template-columns: repeat(auto-fill, 140px);
        gap: 12px;
        padding: 20px;
    }
    
    .friend-avatar-container {
        width: 140px;
        height: 140px;
    }
    
    .progress-ring-outer {
        width: 140px !important;
        height: 140px !important;
    }
    
    .progress-ring-inner {
        width: 130px !important;
        height: 130px !important;
    }
    
    .friend-avatar {
        width: 116px !important;
        height: 116px !important;
        font-size: 22px !important;
    }
    
    /* Groups responsive styling */
    .groups-row {
        gap: 1.4rem;
        padding: 2.5rem 1rem 3.5rem 1rem;
        min-height: 180px;
    }
    
    .group-icon {
        min-width: 115px;
        padding: 0.7rem;
        gap: 0.7rem;
    }
    
    .group-icon-placeholder,
    .group-icon img {
        width: 106px;
        height: 106px;
    }
    
    .all-friends-icon {
        font-size: 1.2rem !important;
    }
    
    .group-name {
        font-size: 1rem;
        max-width: 115px;
    }
}

.friend-box {
    background: linear-gradient(135deg, rgba(55, 167, 179, 0.1) 0%, rgba(55, 167, 179, 0.05) 100%);
    border: 2px solid rgba(237, 198, 81, 0.3);
    border-radius: var(--friend-border-radius-lg);
    padding: var(--friend-spacing-lg);
    box-sizing: border-box;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* backdrop-filter removed to fix blurry hover effect */
    box-shadow: var(--friend-shadow-md);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.friend-box:hover {
    border-color: rgba(237, 198, 81, 0.6);
    transform: translateY(-2px);
    box-shadow: var(--friend-shadow-lg);
}

.friend-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--friend-spacing-md);
    gap: var(--friend-spacing-md);
}

/* Compact Friend Avatar Container with Circular Progress */
.friend-avatar-container {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    cursor: pointer;
    background: none !important;
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box;
    /* Ensure no browser defaults interfere */
    vertical-align: top;
    line-height: 0;
}

.friend-avatar-container:hover {
    transform: scale(1.05);
}

/* Special styling for current user */
.friend-avatar-container.current-user .friend-avatar {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.4) !important;
}

.progress-ring-outer,
.progress-ring-inner {
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
    background: none !important;
    border: none !important;
    outline: none !important;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: top;
    box-sizing: border-box;
}

.progress-ring-outer {
    z-index: 1;
}

.progress-ring-inner {
    top: 5px;
    left: 5px;
    z-index: 2;
}

.progress-ring-daily,
.progress-ring-weekly {
    transition: stroke-dashoffset 0.6s ease-in-out;
    stroke-linecap: round;
}

/* Eliminate any SVG spacing issues */
.friend-avatar-container svg {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    display: block;
    vertical-align: top;
    box-sizing: border-box;
}

.friend-avatar-container svg circle {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.friend-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: none !important;
    outline: none !important;
    object-fit: cover;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #edc651 0%, #d4b13d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #02222b;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    /* Eliminate any gray buffer */
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    /* Force no browser defaults */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
}

.friend-avatar:hover {
    transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    box-shadow: var(--friend-shadow-md);
}

/* Friend Info Section */
.friend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-xs);
}

.friend-progress-labels {
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-xs);
}

.friend-progress-labels .progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--friend-font-sm);
    font-weight: 500;
    padding: 2px 0;
}

.friend-progress-labels .progress-label.daily {
    color: #37A7b3;
}

.friend-progress-labels .progress-label.weekly {
    color: #edc651;
}

/* Enhanced hover effects for compact avatars */
.friend-avatar-container:hover .progress-ring-daily,
.friend-avatar-container:hover .progress-ring-weekly {
    filter: brightness(1.2);
}

.friend-avatar-container:hover .friend-avatar {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Avatar fallback styling */
.friend-avatar:not([src]), 
.friend-avatar[src=""], 
.friend-avatar[src*="default-avatar"] {
    background: linear-gradient(135deg, #edc651 0%, #d4b13d 100%);
}

/* Avatar with actual image */
.friend-avatar[src]:not([src*="default-avatar"]) {
    background: none;
    color: transparent;
}

/* Loading state for avatars */
.friend-avatar[loading="lazy"] {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.friend-avatar[loading="lazy"]:not([src*="default-avatar"]) {
    opacity: 1;
}

.friend-name {
    font-size: var(--friend-font-lg);
    font-weight: 700;
    color: #edc651;
    margin: 0;
    line-height: var(--friend-line-height-tight);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.01em;
}

.friend-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-md);
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-xs);
    position: relative;
}

.progress-label {
    font-size: var(--friend-font-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: var(--friend-line-height-tight);
}

.progress-percentage {
    display: none; /* Hide percentage numbers */
}

.friend-progress-bar {
    width: 100%;
    height: clamp(8px, 1.5vh, 12px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--friend-border-radius-sm);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.friend-progress-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: var(--friend-border-radius-sm);
    overflow: hidden;
}

.friend-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shimmer 3s infinite;
    transform: translateX(-100%) skewX(-15deg);
}

.friend-progress-fill.daily {
    background: linear-gradient(90deg, #edc651 0%, #f4b261 50%, #d4b13d 100%); /* Yellow for Graze */
    box-shadow: 0 0 8px rgba(237, 198, 81, 0.3);
}

.friend-progress-fill.weekly {
    background: linear-gradient(90deg, #D15050 0%, #e74c3c 50%, #c0392b 100%); /* Red for Elephant */
    box-shadow: 0 0 8px rgba(209, 80, 80, 0.3);
}

/* Progress states */
.friend-progress-fill.complete {
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 50%, #16a085 100%);
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.3);
}

/* Delete friend button removed - no longer needed */

.no-progress-message {
    text-align: center;
    color: rgba(237, 198, 81, 0.7);
    font-style: italic;
    padding: var(--friend-spacing-md);
    margin: var(--friend-spacing-md) 0;
    font-size: var(--friend-font-sm);
    background: rgba(237, 198, 81, 0.05);
    border-radius: var(--friend-border-radius-md);
    border: 1px dashed rgba(237, 198, 81, 0.3);
    line-height: var(--friend-line-height-relaxed);
}

.no-friends-message {
    text-align: center;
    padding: var(--friend-spacing-xl);
    color: #edc651;
    font-style: italic;
    width: 100%;
    font-size: var(--friend-font-md);
    line-height: var(--friend-line-height-relaxed);
}

.no-friends-message p {
    margin: 0;
    font-size: var(--friend-font-md);
    line-height: var(--friend-line-height-relaxed);
}

/* Enhanced connect friends button */




/* Removed duplicate friends-grid definition that was missing grid-template-columns and conflicting with responsive layout */

.friend-box {
    background: linear-gradient(135deg, rgba(55, 167, 179, 0.1) 0%, rgba(55, 167, 179, 0.05) 100%);
    border: 2px solid var(--accent-color);
    border-radius: var(--friend-border-radius-lg);
    padding: var(--friend-spacing-lg);
    box-sizing: border-box;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* backdrop-filter removed to fix blurry hover effect */
    box-shadow: var(--friend-shadow-md);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.friend-box:hover {
    border-color: var(--accent-hover);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--friend-shadow-lg);
}

.friend-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--friend-spacing-md);
    gap: var(--friend-spacing-sm);
}

.friend-avatar {
    width: clamp(48px, 4vh, 56px);
    height: clamp(48px, 4vh, 56px);
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    object-fit: cover;
    box-shadow: var(--friend-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--app-bg);
    font-size: var(--friend-font-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.friend-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--friend-shadow-md);
}

/* Avatar fallback styling */
.friend-avatar:not([src]), 
.friend-avatar[src=""], 
.friend-avatar[src*="default-avatar"] {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
}

/* Avatar with actual image */
.friend-avatar[src]:not([src*="default-avatar"]) {
    background: none;
    color: transparent;
}

.friend-name {
    font-size: var(--friend-font-lg);
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
    line-height: var(--friend-line-height-tight);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.01em;
}

.friend-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-md);
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-xs);
    position: relative;
}

.progress-label {
    font-size: var(--friend-font-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: var(--friend-line-height-tight);
}

.progress-label::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 50%;
    vertical-align: middle;
}

.progress-label.daily::before {
    background: var(--danger-color);
    box-shadow: 0 0 4px rgba(209, 80, 80, 0.5);
}

.progress-label.weekly::before {
    background: var(--success-color);
    box-shadow: 0 0 4px rgba(55, 167, 179, 0.5);
}

.progress-percentage {
    display: none; /* Hide percentage numbers */
}

.friend-progress-bar {
    width: 100%;
    height: clamp(8px, 1.5vh, 12px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--friend-border-radius-sm);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.friend-progress-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: var(--friend-border-radius-sm);
    overflow: hidden;
}

.friend-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shimmer 3s infinite;
    transform: translateX(-100%) skewX(-15deg);
}

.friend-progress-fill.daily {
    background: linear-gradient(90deg, #edc651 0%, #f4b261 50%, #d4b13d 100%); /* Yellow for Graze */
    box-shadow: 0 0 8px rgba(237, 198, 81, 0.3);
}

.friend-progress-fill.weekly {
    background: linear-gradient(90deg, #D15050 0%, #e74c3c 50%, #c0392b 100%); /* Red for Elephant */
    box-shadow: 0 0 8px rgba(209, 80, 80, 0.3);
}

/* Progress states */
.friend-progress-fill.complete {
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 50%, #16a085 100%);
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.3);
}

/* Delete friend button removed - no longer needed */

.no-progress-message {
    text-align: center;
    color: rgba(237, 198, 81, 0.7);
    font-style: italic;
    padding: var(--friend-spacing-md);
    margin: var(--friend-spacing-md) 0;
    font-size: var(--friend-font-sm);
    background: rgba(237, 198, 81, 0.05);
    border-radius: var(--friend-border-radius-md);
    border: 1px dashed rgba(237, 198, 81, 0.3);
    line-height: var(--friend-line-height-relaxed);
}

.no-friends-message {
    text-align: center;
    padding: var(--friend-spacing-xl);
    color: #edc651;
    font-style: italic;
    width: 100%;
    font-size: var(--friend-font-md);
    line-height: var(--friend-line-height-relaxed);
}

.no-friends-message p {
    margin: 0;
    font-size: var(--friend-font-md);
    line-height: var(--friend-line-height-relaxed);
}

/* Friend Details Modal Styles */
.friend-details-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.friend-details-header {
    display: flex;
    align-items: center;
    gap: var(--friend-spacing-lg);
    margin-bottom: var(--friend-spacing-xl);
    padding-bottom: var(--friend-spacing-lg);
    border-bottom: 2px solid rgba(237, 198, 81, 0.3);
}

.friend-details-avatar {
    width: clamp(80px, 8vh, 100px);
    height: clamp(80px, 8vh, 100px);
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    object-fit: cover;
    box-shadow: var(--friend-shadow-md);
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
}

.friend-details-info h2 {
    color: var(--accent-color);
    margin: 0 0 var(--friend-spacing-sm) 0;
    font-size: var(--friend-font-xl);
    font-weight: 700;
}

.friend-details-status {
    color: var(--text-color);
    font-size: var(--friend-font-sm);
    margin: 0;
    padding: var(--friend-spacing-xs) var(--friend-spacing-sm);
    background: rgba(237, 198, 81, 0.1);
    border-radius: var(--friend-border-radius-sm);
    display: inline-block;
}

.friend-details-progress {
    margin-bottom: var(--friend-spacing-xl);
}

.friend-details-progress h3 {
    color: var(--accent-color);
    margin: 0 0 var(--friend-spacing-lg) 0;
    font-size: var(--friend-font-lg);
    font-weight: 600;
}

.no-progress-details {
    text-align: center;
    padding: var(--friend-spacing-lg);
    background: rgba(55, 167, 179, 0.05);
    border-radius: var(--friend-border-radius-md);
    border: 1px solid rgba(55, 167, 179, 0.2);
}

.no-progress-details p {
    margin: var(--friend-spacing-sm) 0;
    color: var(--text-color);
    font-size: var(--friend-font-md);
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: var(--friend-spacing-lg);
}

.progress-detail-item {
    display: flex;
    align-items: center;
    gap: var(--friend-spacing-md);
    padding: var(--friend-spacing-md);
    background: rgba(55, 167, 179, 0.05);
    border-radius: var(--friend-border-radius-md);
    border: 1px solid rgba(55, 167, 179, 0.2);
}

.progress-detail-label {
    display: flex;
    align-items: center;
    gap: var(--friend-spacing-sm);
    font-weight: 600;
    color: var(--text-color);
    font-size: var(--friend-font-md);
    min-width: 140px;
}

.progress-icon {
    font-size: var(--friend-font-lg);
}

.progress-detail-bar {
    flex: 1;
    height: clamp(12px, 2vh, 16px);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--friend-border-radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-detail-fill {
    height: 100%;
    border-radius: var(--friend-border-radius-sm);
    transition: width 0.3s ease;
    position: relative;
}

.progress-detail-fill.daily {
    background: linear-gradient(90deg, #edc651 0%, #f4b261 50%, #d4b13d 100%); /* Yellow for Graze */
    box-shadow: 0 0 8px rgba(237, 198, 81, 0.3);
}

.progress-detail-fill.weekly {
    background: linear-gradient(90deg, #D15050 0%, #e74c3c 50%, #c0392b 100%); /* Red for Elephant */
    box-shadow: 0 0 8px rgba(209, 80, 80, 0.3);
}

.progress-detail-fill.combined {
    background: linear-gradient(90deg, #8e5ab0 0%, #D15050 100%);
}

.progress-detail-fill.complete {
    background: linear-gradient(90deg, #6dbb53 0%, #37A7b3 100%);
}

.progress-detail-percentage {
    font-weight: 700;
    color: var(--accent-color);
    font-size: var(--friend-font-md);
    min-width: 50px;
    text-align: right;
}

.friend-details-actions {
    display: flex;
    justify-content: center;
    gap: var(--friend-spacing-md);
    padding-top: var(--friend-spacing-lg);
    border-top: 2px solid rgba(237, 198, 81, 0.3);
}

.friend-action-btn {
    padding: var(--friend-spacing-md) var(--friend-spacing-lg);
    border: none;
    border-radius: var(--friend-border-radius-md);
    font-size: var(--friend-font-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.remove-friend-btn {
    background: linear-gradient(135deg, #D15050 0%, #b33939 100%);
    color: white;
    box-shadow: var(--friend-shadow-sm);
}

.remove-friend-btn:hover {
    background: linear-gradient(135deg, #b33939 0%, #8a2a2a 100%);
    transform: translateY(-2px);
    box-shadow: var(--friend-shadow-md);
}

/* Responsive adjustments for friend details modal */
@media (max-width: 768px) {
    .friend-details-content {
        max-width: 95vw;
        margin: var(--friend-spacing-md);
    }
    
    .friend-details-header {
        flex-direction: column;
        text-align: center;
        gap: var(--friend-spacing-md);
    }
    
    .progress-detail-item {
        flex-direction: column;
        align-items: stretch;
        gap: var(--friend-spacing-sm);
    }
    
    .progress-detail-label {
        min-width: auto;
        justify-content: center;
    }
    
    .progress-detail-percentage {
        text-align: center;
        min-width: auto;
    }
}

/* Group Creation Modal Styles */
.group-creation-content {
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.group-creation-content h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffffff;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #2a2a2a;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #888;
    font-size: 0.8rem;
}

.privacy-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #2a2a2a;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.radio-option:hover {
    border-color: #4CAF50;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 50%;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    position: relative;
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #4CAF50;
    background-color: #4CAF50;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
}

.option-content {
    flex: 1;
}

.option-content strong {
    display: block;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.option-content small {
    color: #888;
    font-size: 0.8rem;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #2a2a2a;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.checkbox-option:hover {
    border-color: #4CAF50;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 4px;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    position: relative;
    flex-shrink: 0;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #4CAF50;
    background-color: #4CAF50;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4CAF50;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #666;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #555;
    transform: translateY(-2px);
}

/* Group Management Modal Styles */
.group-management-content {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.group-management-content h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-align: center;
}

/* Responsive Design for Group Modals */
@media (max-width: 768px) {
    .group-creation-content,
    .group-management-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .privacy-options {
        gap: 0.5rem;
    }
    
    .radio-option,
    .checkbox-option {
        padding: 0.5rem;
    }
}

/* Group Invitation Modal Styles */
.group-invitation-content {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: var(--friend-border-radius-lg);
    padding: var(--friend-spacing-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.group-invitation-content h2 {
    color: var(--accent-color);
    margin: 0 0 var(--friend-spacing-lg) 0;
    font-size: var(--friend-font-xl);
    font-weight: 700;
    text-align: center;
}

.invitation-info {
    margin-bottom: var(--friend-spacing-xl);
    padding: var(--friend-spacing-lg);
    background: rgba(55, 167, 179, 0.05);
    border-radius: var(--friend-border-radius-md);
    border: 1px solid rgba(55, 167, 179, 0.2);
}

.invitation-info h3 {
    color: var(--accent-color);
    margin: 0 0 var(--friend-spacing-sm) 0;
    font-size: var(--friend-font-lg);
    font-weight: 600;
}

.invitation-info p {
    margin: var(--friend-spacing-sm) 0;
    color: var(--text-color);
    font-size: var(--friend-font-md);
}

.invitation-code-section,
.invitation-qr-section {
    margin-bottom: var(--friend-spacing-xl);
}

.invitation-code-section h4,
.invitation-qr-section h4 {
    color: var(--text-color);
    margin: 0 0 var(--friend-spacing-md) 0;
    font-size: var(--friend-font-md);
    font-weight: 600;
}

.invitation-code-display {
    display: flex;
    align-items: center;
    gap: var(--friend-spacing-md);
    padding: var(--friend-spacing-md);
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--friend-border-radius-md);
    border: 1px solid var(--border-color);
}

#invitationCodeDisplay {
    font-family: 'Courier New', monospace;
    font-size: var(--friend-font-lg);
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 2px;
    flex: 1;
}

.invitation-actions {
    display: flex;
    gap: var(--friend-spacing-md);
    justify-content: center;
    margin-top: var(--friend-spacing-xl);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: var(--friend-spacing-md) var(--friend-spacing-lg);
    border-radius: var(--friend-border-radius-md);
    font-size: var(--friend-font-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

/* Join Group Modal Styles */
.join-group-content {
    max-width: 500px;
    width: 90%;
    background: var(--bg-color);
    border-radius: var(--friend-border-radius-lg);
    padding: var(--friend-spacing-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.join-group-content h2 {
    color: var(--accent-color);
    margin: 0 0 var(--friend-spacing-lg) 0;
    font-size: var(--friend-font-xl);
    font-weight: 700;
    text-align: center;
}

.join-group-form {
    margin-bottom: var(--friend-spacing-lg);
}

.join-group-form .form-group {
    margin-bottom: var(--friend-spacing-lg);
}

.join-group-form label {
    display: block;
    margin-bottom: var(--friend-spacing-sm);
    color: var(--text-color);
    font-size: var(--friend-font-md);
    font-weight: 600;
}

.join-group-form input[type="text"] {
    width: 100%;
    padding: var(--friend-spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--friend-border-radius-md);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: var(--friend-font-md);
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.join-group-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(55, 167, 179, 0.1);
}

.join-group-form small {
    display: block;
    margin-top: var(--friend-spacing-sm);
    color: var(--text-muted);
    font-size: var(--friend-font-sm);
}

.join-group-form .form-actions {
    display: flex;
    gap: var(--friend-spacing-md);
    justify-content: center;
    margin-top: var(--friend-spacing-lg);
}

/* Responsive adjustments for group invitation modals */
@media (max-width: 768px) {
    .group-invitation-content,
    .join-group-content {
        width: 95%;
        padding: var(--friend-spacing-lg);
    }

    .invitation-actions {
        flex-direction: column;
    }

    .join-group-form .form-actions {
        flex-direction: column;
    }

    #invitationCodeDisplay {
        font-size: var(--friend-font-md);
        letter-spacing: 1px;
    }
}

/* Group Management Styles */
.group-management-content {
    max-width: 600px;
    width: 90%;
    background: #2a2a2a;
    border-radius: var(--friend-border-radius-lg);
    padding: var(--friend-spacing-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 2px solid #444;
}

.group-management-content h2 {
    color: var(--accent-color);
    margin: 0 0 var(--friend-spacing-md) 0;
    font-size: var(--friend-font-xl);
    font-weight: 700;
    text-align: center;
}

.group-description {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--friend-spacing-lg);
    font-size: var(--friend-font-md);
    line-height: 1.5;
}

.group-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--friend-spacing-lg);
    padding: var(--friend-spacing-md);
    background: var(--input-bg);
    border-radius: var(--friend-border-radius-md);
    border: 1px solid var(--border-color);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: var(--friend-font-sm);
    font-weight: 600;
    margin-bottom: var(--friend-spacing-xs);
}

.stat-value {
    display: block;
    color: var(--accent-color);
    font-size: var(--friend-font-lg);
    font-weight: 700;
}

.group-actions {
    display: flex;
    gap: var(--friend-spacing-md);
    justify-content: center;
    margin-bottom: var(--friend-spacing-lg);
    flex-wrap: wrap;
}

.members-section {
    margin-bottom: var(--friend-spacing-lg);
}

.members-section h3 {
    color: var(--text-color);
    margin-bottom: var(--friend-spacing-md);
    font-size: var(--friend-font-lg);
    font-weight: 600;
    text-align: center;
}

.members-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--friend-border-radius-md);
    background: var(--input-bg);
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--friend-spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.member-item:last-child {
    border-bottom: none;
}

.member-item:hover {
    background: rgba(55, 167, 179, 0.1);
}

.member-info {
    flex: 1;
}

.member-name {
    display: flex;
    align-items: center;
    gap: var(--friend-spacing-sm);
    color: var(--text-color);
    font-size: var(--friend-font-md);
    font-weight: 600;
    margin-bottom: var(--friend-spacing-xs);
}

.member-joined {
    color: var(--text-muted);
    font-size: var(--friend-font-sm);
}

.role-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--friend-font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.creator {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.role-badge.admin {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.role-badge.member {
    background: linear-gradient(135deg, #37a7b3 0%, #2c7a7a 100%);
    color: white;
}

.btn-remove-member {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: var(--friend-spacing-sm) var(--friend-spacing-md);
    border-radius: var(--friend-border-radius-sm);
    font-size: var(--friend-font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-remove-member:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.no-members {
    text-align: center;
    color: var(--text-muted);
    padding: var(--friend-spacing-lg);
    font-style: italic;
}

.leave-group-section,
.delete-group-section {
    text-align: center;
    margin-top: var(--friend-spacing-lg);
    padding-top: var(--friend-spacing-lg);
    border-top: 1px solid var(--border-color);
}

.invitations-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--friend-border-radius-md);
    background: var(--input-bg);
    margin-bottom: var(--friend-spacing-lg);
}

.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--friend-spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.invitation-item:last-child {
    border-bottom: none;
}

.invitation-item:hover {
    background: rgba(55, 167, 179, 0.1);
}

.invitation-code {
    font-family: 'Courier New', monospace;
    font-size: var(--friend-font-md);
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.invitation-details {
    flex: 1;
    margin-left: var(--friend-spacing-md);
    color: var(--text-muted);
    font-size: var(--friend-font-sm);
}

.invitation-details div {
    margin-bottom: 2px;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: var(--friend-spacing-xl);
    font-style: italic;
}

.error-message {
    text-align: center;
    color: var(--text-color);
    padding: var(--friend-spacing-lg);
}

.error-message h3 {
    color: #e74c3c;
    margin-bottom: var(--friend-spacing-md);
}

.error-message p {
    color: var(--text-muted);
    margin-bottom: var(--friend-spacing-lg);
}

/* Responsive adjustments for group management */
@media (max-width: 768px) {
    .group-management-content {
        width: 95%;
        padding: var(--friend-spacing-lg);
    }

    .group-stats {
        flex-direction: column;
        gap: var(--friend-spacing-md);
    }

    .group-actions {
        flex-direction: column;
    }

    .member-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--friend-spacing-sm);
    }

    .btn-remove-member {
        align-self: flex-end;
    }

    .invitation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--friend-spacing-sm);
    }

    .invitation-code {
        font-size: var(--friend-font-sm);
    }

    .invitation-details {
        margin-left: 0;
    }
}

/* Progress Visualization Styles */
.progress-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #333;
}

.progress-section h3 {
    margin-bottom: 1rem;
    color: #ffffff;
    font-size: 1.1rem;
}

.progress-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.progress-tab {
    background: none;
    border: none;
    color: #888;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.progress-tab:hover {
    color: #ffffff;
}

.progress-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

.progress-content {
    min-height: 200px;
}

.member-progress-item {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
}

.member-progress-item:hover {
    background: #333;
    transform: translateX(2px);
}

.member-progress-item.completed {
    border-left-color: #4CAF50;
}

.member-progress-item:not(.completed) {
    border-left-color: #FF9800;
}

.member-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.member-progress-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

.member-progress-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: #4CAF50;
    color: #ffffff;
}

.status-badge.in-progress {
    background: #FF9800;
    color: #ffffff;
}

.member-progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.progress-exercise {
    color: #cccccc;
    font-style: italic;
}

.progress-counts {
    color: #888;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

/* Removed conflicting .progress-bar rule that was causing green color */

.member-progress-item.completed .progress-bar {
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
}

.member-progress-item:not(.completed) .progress-bar {
    background: linear-gradient(90deg, #FF9800, #FFB74D);
}

.no-progress {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.no-progress p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.no-progress small {
    font-size: 0.8rem;
    color: #666;
}

/* Responsive adjustments for progress visualization */
@media (max-width: 768px) {
    .progress-tabs {
        gap: 0.25rem;
    }
    
    .progress-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .member-progress-item {
        padding: 0.75rem;
    }
    
    .member-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .member-progress-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .progress-exercise {
        font-size: 0.8rem;
    }
    
    .progress-counts {
        font-size: 0.8rem;
    }
}

/* Visibility Settings Styles */
.visibility-settings-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.visibility-settings-section h3 {
    margin-bottom: 1rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

.visibility-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.visibility-options .radio-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.visibility-options .radio-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.visibility-options .radio-option input[type="radio"] {
    display: none;
}

.visibility-options .radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.visibility-options .radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #4CAF50;
    background: #4CAF50;
}

.visibility-options .radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

.visibility-options .option-content {
    flex: 1;
}

.visibility-options .option-content strong {
    display: block;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.visibility-options .option-content small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.visibility-note {
    display: block;
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .visibility-settings-section {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    .visibility-settings-section h3 {
        font-size: 1rem;
    }
    
    .visibility-options .radio-option {
        padding: 0.5rem;
    }
    
    .visibility-options .option-content strong {
        font-size: 0.9rem;
    }
    
    .visibility-options .option-content small {
        font-size: 0.8rem;
    }
}

/* Group Size Validation Styles */
.validation-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
    display: none;
}

.validation-error.show {
    display: block;
}

/* Group Capacity Styles */
.capacity-normal {
    color: #4CAF50;
}

.capacity-warning {
    color: #FF9800;
}

.capacity-full {
    color: #f44336;
}

.capacity-alert {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    font-weight: 500;
}

.capacity-notice-alert {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.capacity-warning-alert {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.capacity-full-alert {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

/* Form validation styles */
.form-group input:invalid {
    border-color: #ff6b6b;
}

.form-group input:invalid:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.form-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Enhanced Member List with Progress Tracking */
.member-item {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #666;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.member-item:hover {
    background: #333;
    transform: translateX(2px);
}

.member-item.completed {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.member-item.has-progress {
    border-left-color: #FF9800;
    background: rgba(255, 152, 0, 0.05);
}

.member-item.no-progress {
    border-left-color: #666;
    opacity: 0.7;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #555;
    flex-shrink: 0;
}

.member-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.member-name .role-badge {
    flex-shrink: 0;
}

.member-progress-status {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.member-details {
    margin-bottom: 0.75rem;
}

.member-joined {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.member-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.progress-exercise {
    color: #cccccc;
    font-style: italic;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-counts {
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.member-progress-bar-container {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.member-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF9800, #FFB74D);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.member-item.completed .member-progress-bar {
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
}

.member-item.has-progress .member-progress-bar {
    background: linear-gradient(90deg, #FF9800, #FFB74D);
}

.status-badge.no-data {
    background: #666;
    color: #ffffff;
}

/* Responsive adjustments for enhanced member list */
@media (max-width: 768px) {
    .member-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .member-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .member-progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .progress-counts {
        margin-left: 0;
    }
    
    .btn-remove-member {
        align-self: flex-end;
    }
}

/* Enhanced Member List Header and Controls */
.members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.members-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
}

.members-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.5rem;
    color: #cccccc;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    min-width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.members-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.members-count {
    color: #cccccc;
    font-size: 0.9rem;
    font-weight: 500;
}

.members-progress-summary {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

/* Responsive adjustments for member list header */
@media (max-width: 768px) {
    .members-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .members-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.add-group-btn .group-name {
    color: #ffffff;
    transition: color 0.3s ease;
}

.add-group-btn:hover .group-name {
    color: #37A7b3;
}

/* Group Management Button */
.group-manage-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background-color: #37A7b3;
    color: #ffffff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    /* Ensure perfect circle */
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.group-manage-btn:hover {
    background-color: #2d8a94;
    opacity: 1;
}

.group-icon:hover .group-manage-btn {
    opacity: 1;
}

.group-icon.active .group-manage-btn {
    opacity: 1;
    background-color: #2d8a94;
}

@media (max-width: 768px) {
    .group-manage-btn {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -3px;
        right: -3px;
    }
}

/* Split Exercise Controls */
.split-exercise-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.split-exercise-controls .left-side,
.split-exercise-controls .right-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.split-exercise-controls .left-side h4,
.split-exercise-controls .right-side h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #ffffff;
}

.split-exercise-controls .left-side {
    border-left: 4px solid #4CAF50;
}

.split-exercise-controls .right-side {
    border-left: 4px solid #2196F3;
}

.split-exercise-controls button {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    background: #333;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.split-exercise-controls button:hover {
    background: #555;
}

.split-exercise-controls button:active {
    background: #222;
}

/* Responsive adjustments for split controls */
@media (max-width: 480px) {
    .split-exercise-controls {
        gap: 0.5rem;
    }
    
    .split-exercise-controls .left-side,
    .split-exercise-controls .right-side {
        padding: 0.75rem;
    }
    
    .split-exercise-controls button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Split Progress Display */
.split-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.split-progress .left-progress,
.split-progress .right-progress,
.split-progress .total-progress {
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.split-progress .left-progress {
    border-left: 3px solid #4CAF50;
}

.split-progress .right-progress {
    border-left: 3px solid #2196F3;
}

.split-progress .total-progress {
    border-left: 3px solid #FF9800;
    font-weight: bold;
}

.split-progress .progress-count {
    color: #FFD700;
    font-weight: bold;
}

.split-progress .progress-goal {
    color: #ffffff;
}

/* Responsive adjustments for split progress */
@media (max-width: 480px) {
    .split-progress {
        gap: 0.25rem;
    }
    
    .split-progress .left-progress,
    .split-progress .right-progress,
    .split-progress .total-progress {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
}