/*
 * style.css
 * Global stylesheet for Goonr
 * Theme: B&W Liquid Glass
 */

/* --- Base & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000;
    color: rgba(255, 255, 255, 0.9);
    min-height: 100vh;
    overflow-x: hidden;
    /* * THE NAV FIX: 
     * We add padding to the body itself to push all content down,
     * compensating for the fixed-position nav bar.
     */
    padding-top: 80px; /* This is for desktop */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: rgba(255, 255, 255, 0.6);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 2; 
}

.main-wrapper {
    /* * THE NAV FIX: 
     * We remove the padding from here. The body now handles it.
     */
    /* padding-top: 80px; */ 
    min-height: calc(100vh - 155px); /* 100vh minus body-padding(80) and footer(75) */
    position: relative;
}

/* Background gradient orbs */
.bg-gradient {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0; 
    animation: pulse 8s ease-in-out infinite;
}
.gradient-1 { top: -250px; left: -250px; background: #fff; }
.gradient-2 { bottom: -250px; right: -250px; background: #666; animation-delay: 4s; }

/* --- Glass Card Component --- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 2.5rem;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease forwards;
}

/* --- Navigation Bar --- */
.main-nav {
    /* * THE NAV FIX: 
     * The nav is now ALWAYS fixed, on mobile and desktop.
     * This ensures its z-index is always respected.
     */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 1.5rem;
    z-index: 200; 
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
    padding: 0.5rem;
}
.nav-link:hover, .nav-link.active {
    color: #fff;
}
.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 201; 
    padding: 10px;
    margin: -10px;
}
.nav-toggle-icon {
    width: 24px;
    height: 2px;
    background: white;
    display: block;
    position: relative;
    transition: all 0.3s ease;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: '';
    width: 24px;
    height: 2px;
    background: white;
    display: block;
    position: absolute;
    transition: all 0.3s ease;
}
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }


/* --- Buttons --- */
.btn {
    width: 100%;
    padding: 1rem 1.2rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-decoration: none;
    text-align: center;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
}
.btn-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.5);
}
.btn-danger:hover {
    background: rgba(220, 38, 38, 0.4);
    color: #fca5a5;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.2);
}
.btn-sm {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
}
.btn-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}
.btn-link:hover {
    color: #fff;
}


/* --- Forms --- */
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}
.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-textarea {
    min-height: 80px;
    resize: vertical;
}
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.1);
}
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.form-checkbox input[type="checkbox"]:checked {
    background: #fff;
    border-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%path d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3e%3c/svg%3e");
}
.form-checkbox label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}


/* --- Footer --- */
.footer {
    padding: 2rem 1.5rem;
    margin-top: 2rem; 
    z-index: 2; 
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-content {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}
.footer-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}
.legal-links {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}
.legal-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}
.legal-link:hover {
    color: rgba(255, 255, 255, 0.8);
}
.legal-separator {
    color: rgba(255, 255, 255, 0.2);
}


/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-danger { color: #f87171; }
.text-success { color: #4ade80; }
.text-muted { color: rgba(255, 255, 255, 0.4); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.hr-glass {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}
.global-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 999;
    font-weight: 600;
    transition: opacity 0.5s ease;
}


/* --- Specific Page Styles --- */

/* Dashboard */
.streak-display {
    text-align: center;
    margin-bottom: 2rem;
}
.streak-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.streak-time {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.streak-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-item {
    text-align: center;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}
.goal-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.goal-display h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.goal-display ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}
.goal-display li {
    position: relative;
    padding-left: 25px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.75rem;
}
.goal-display li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #fff;
    font-weight: 700;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.goal-header h3 {
    margin-bottom: 0;
}

/* Custom Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}
.custom-checkbox:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}
.custom-checkbox input[type="checkbox"] {
    display: none;
}
.custom-checkbox .checkbox-label {
    position: relative;
    padding-left: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
.custom-checkbox .checkbox-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
}
.custom-checkbox input[type="checkbox"]:checked + .checkbox-label::before {
    background-color: #fff;
    border-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%path d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3e%3c/svg%3e");
    background-position: center;
}

/* Custom Reasons List */
.custom-reasons-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}
.custom-reasons-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.remove-reason-btn {
    background: none; border: none; color: #f87171; font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.add-reason-group { display: flex; gap: 1rem; }
.add-reason-group .btn { width: auto; }
/* Error Page */
/* --- Error Page Styles --- */
/* These styles are for the custom error page in callback.php */
.error-page {
    /* Override default body padding and center content */
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-page .main-wrapper {
    /* Ensure no minimum height interferes with centering */
    min-height: auto;
    /* Remove default padding */
    padding: 1rem;
}

.error-page .glass-card {
    /* Center the text *inside* the card */
    text-align: center;
    /* Give the card a max width */
    max-width: 500px;
    /* Ensure it's centered (margin: auto) and has no bottom margin */
    margin: 0 auto; 
}

.error-page .btn {
    /* Override default 100% width for buttons */
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
    margin-top: 1.5rem;
    text-decoration: none;
}

/* Groups Page */
.group-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.group-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    overflow: hidden; 
}
.group-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.group-card-avatar {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.1);
}
.group-card-avatar-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    background-color: rgba(255, 255, 255, 0.05);
}
.group-card-info {
    padding: 1.5rem;
}
.group-card h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.group-card-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}


/* Group Detail Page */
.group-header {
    text-align: center;
    margin-bottom: 2rem;
}
.group-title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}
.group-avatar,
.group-avatar-placeholder,
.group-admin-button {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.group-avatar-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 16px; 
}
.group-avatar {
    border-radius: 16px; 
    border: 2px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    display: block;
}
.group-avatar-placeholder {
    border-radius: 16px;
    background-color: transparent; 
}
.group-header h1 {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.group-admin-button {
    border-radius: 16px;
    padding: 0; 
    font-size: 1.5rem; 
    line-height: 1;
}

.group-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.grid-col {
    display: flex;
    flex-direction: column;
    min-width: 0; 
}
.role-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5rem;
    vertical-align: -0.125em;
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard {
    list-style: none;
    padding: 0;
    margin: 0;
}
.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem; 
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.leaderboard-item:last-child {
    border-bottom: none;
}
.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}
.leaderboard-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    min-width: 30px;
    text-align: right;
    flex-shrink: 0;
}
.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.leaderboard-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    white-space: normal;
    word-break: break-all; 
    flex: 1; 
    min-width: 0;
}
.leaderboard-streak {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Card Header (for admin button) */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.card-header h2 {
    margin-bottom: 0;
}
.card-header .btn-sm {
    margin-top: -5px; 
    margin-bottom: -5px;
}

/* Activity Feed */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.feed-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}
.feed-item:last-child {
    border-bottom: none;
}
.feed-item:first-child {
    padding-top: 0;
}
.feed-item.hidden-message {
    display: none;
}
.feed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.feed-content {
    flex-grow: 1;
    position: relative;
    min-width: 0; 
}
.feed-content strong {
    color: #fff;
    font-weight: 600;
}
.feed-message {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
    word-break: break-word;
    padding-right: 25px;
}
.feed-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}
.feed-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    margin-left: 1rem;
}
.delete-message-form {
    position: absolute;
    top: -5px;
    right: 0;
}
.delete-message-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 5px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}
.delete-message-btn:hover {
    color: #f87171;
}


/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 300; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.modal-content {
    max-width: 500px;
    margin: auto;
    animation: float 0.3s ease-out;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.modal-header h2 {
    margin-bottom: 0;
}
.close-btn {
    color: rgba(255, 255, 255, 0.4);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
.close-btn:hover,
.close-btn:focus {
    color: #fff;
    text-decoration: none;
}
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Confirm Modal */
.confirm-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}
.confirm-modal-footer .btn {
    width: 48%;
}

/* Image Modal */
#imageModal .modal-content {
    max-width: 500px; 
    padding: 1rem; 
    background: rgba(255, 255, 255, 0.05);
}
#imageModalSrc {
    width: 100%;
    height: auto;
    border-radius: 24px;
    display: block;
}

/* Default Avatar Grid */
.default-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.default-avatar-label {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}
.default-avatar-label img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.default-avatar-label input[type="radio"] {
    display: none;
}
.default-avatar-label input[type="radio"]:checked + img {
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}
.default-avatar-label:hover {
    border-color: rgba(255, 255, 255, 0.5);
}


/* Cropper.js Modal Styles */
#cropperModal {
    z-index: 301;
}
#cropperModal .modal-content {
    max-width: 600px;
}
#cropperContainer {
    width: 100%;
    height: 400px;
    background: #000;
}
#cropperContainer img {
    display: block;
    max-width: 100%;
}
.cropper-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}


/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes float {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(1.1); }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    
    /* * THE NAV FIX (Mobile): 
     * The body padding is reduced for mobile view.
     */
    body {
        padding-top: 68px; /* Height of mobile nav */
    }
    .main-wrapper {
        min-height: calc(100vh - 143px); /* 100vh - body-padding(68) - footer(75) */
    }
    /* END OF FIX */
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 68px; /* height of nav */
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(5px);
        padding: 1rem;
        gap: 0;
        /* This z-index makes it appear on top of content */
        z-index: 199; 
    }
    .nav-links.active {
        display: flex;
    }
    .nav-link {
        width: 100%;
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .nav-link:last-child {
        border-bottom: none;
    }
    .nav-toggle {
        display: block;
        z-index: 201;
    }

    .container {
        padding: 1rem 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
        border-radius: 24px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }

    .streak-time {
        font-size: 2.5rem;
    }
    .streak-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    .btn {
        padding: 0.9rem 1rem;
        font-size: 1rem;
        border-radius: 12px;
    }
    .form-input, .form-textarea {
        padding: 0.9rem;
    }
    
    /* Group page responsive */
    .group-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-actions form {
        width: 100%;
    }
    .admin-actions .btn-sm {
        width: 100%;
    }

    /* "Edit Your Why" modal on mobile */
    .add-reason-group {
        flex-direction: column;
    }
    .add-reason-group .btn {
        width: 100%;
    }

    /* Fix modal cutoff on mobile */
    .modal {
        align-items: flex-start;
        padding-top: 5vh;
    }

    /* Modal on mobile */
    .modal-content {
        width: 90%;
        margin: 5% auto;
    }
    
    /* Group header on mobile */
    .group-title-container {
        gap: 0.5rem;
    }
    .group-avatar, .group-avatar-placeholder, .group-admin-button {
        width: 50px;
        height: 50px;
    }
    .group-admin-button {
        font-size: 1.2rem;
    }
    
    /* Leaderboard on mobile */
    .leaderboard-name {
        font-size: 1rem; 
        white-space: normal;
        word-break: break-all;
    }
    .leaderboard-streak {
        font-size: 1rem;
    }
}