﻿/* ============================================
   Tribal Survival Groups - Main Stylesheet
   ============================================ */

/* ==========================================
   HERO BANNER - Full Width
   ========================================== */
.ts-hero-banner {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 280px;
    overflow: hidden;
    margin-bottom: 0;
}

    .ts-hero-banner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

/* ==========================================
   PAGE LAYOUT
   ========================================== */
.ts-groups-page {
    padding: 2rem 0 3rem;
    min-height: 60vh;
    background: linear-gradient(to bottom, #f8faf8 0%, #ffffff 100%);
}

.ts-page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.ts-page-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c5530;
    margin: 0 0 0.5rem;
}

.ts-page-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

.ts-groups-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

.ts-content-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* ==========================================
   LOGIN PROMPT
   ========================================== */
.login-prompt-container {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.login-prompt {
    font-size: 1.15rem;
    color: #555;
}

    .login-prompt a {
        color: #2c5530;
        font-weight: 600;
        text-decoration: underline;
    }

        .login-prompt a:hover {
            color: #1a3a1e;
        }

/* ==========================================
   ACTION BAR
   ========================================== */
.groups-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #2c5530 0%, #3d7344 100%);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons-left,
.action-buttons-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.groups-action-bar .btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.groups-action-bar .btn-primary {
    background: #fff;
    color: #2c5530;
    border-color: #fff;
}

    .groups-action-bar .btn-primary:hover {
        background: #f0f0f0;
        border-color: #f0f0f0;
    }

.groups-action-bar .btn-success {
    background: #ffc107;
    color: #333;
    border-color: #ffc107;
}

    .groups-action-bar .btn-success:hover {
        background: #e0a800;
        border-color: #e0a800;
    }

.groups-action-bar .btn-outline-primary {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

    .groups-action-bar .btn-outline-primary:hover {
        background: rgba(255,255,255,0.15);
        border-color: #fff;
    }

.invite-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.position-relative {
    position: relative;
}

/* ==========================================
   NO GROUPS MESSAGE
   ========================================== */
.no-groups-message {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.no-groups-icon {
    font-size: 4.5rem;
    color: #2c5530;
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.no-groups-message h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.75rem;
}

.no-groups-message p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.no-groups-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

    .no-groups-actions .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

/* ==========================================
   GROUP TABS
   ========================================== */
.groups-tabs-container {
    margin-bottom: 0;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    padding: 0.5rem 0.5rem 0;
}

.groups-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: none;
}

    .groups-tabs .nav-item {
        margin: 0;
    }

    .groups-tabs .nav-link {
        padding: 0.85rem 1.5rem;
        color: #555;
        background: transparent;
        border: none;
        border-radius: 8px 8px 0 0;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .groups-tabs .nav-link:hover {
            color: #2c5530;
            background: rgba(44, 85, 48, 0.08);
        }

        .groups-tabs .nav-link.active {
            color: #2c5530;
            background: #fff;
            font-weight: 600;
            box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
        }

.owner-badge {
    color: #ffc107;
    font-size: 0.9rem;
}

/* ==========================================
   GROUP CONTENT
   ========================================== */
.group-content {
    background: #fff;
    border-radius: 0 0 10px 10px;
    border: 1px solid #e9ecef;
    border-top: none;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8faf8 0%, #fff 100%);
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.group-info {
    flex: 1;
    min-width: 250px;
}

.group-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c5530;
    margin: 0 0 0.5rem;
}

.group-description {
    color: #666;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.group-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #666;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

    .meta-item i {
        color: #2c5530;
    }

.public-badge {
    background: #d4edda !important;
    color: #155724 !important;
}

    .public-badge i {
        color: #155724 !important;
    }

.private-badge {
    background: #e9ecef !important;
    color: #6c757d !important;
}

    .private-badge i {
        color: #6c757d !important;
    }

.group-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==========================================
   GROUP SECTIONS
   ========================================== */
.group-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

    .group-section:last-child {
        border-bottom: none;
    }

.section-header {
    margin-bottom: 1.25rem;
}

    .section-header h3 {
        font-size: 1.15rem;
        font-weight: 600;
        color: #333;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .section-header h3 i {
            color: #2c5530;
            font-size: 1rem;
        }

/* ==========================================
   ENTRIES
   ========================================== */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.entry-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .entry-card:hover {
        background: #f0f0f0;
    }

    .entry-card.my-entry {
        background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
        border-left: 4px solid #2c5530;
    }

.entry-name {
    font-weight: 500;
    color: #333;
}

.add-entry-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px dashed #e0e0e0;
}

    .add-entry-section h4 {
        font-size: 0.95rem;
        color: #555;
        margin-bottom: 1rem;
        font-weight: 500;
    }

.available-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

    .available-entries .btn {
        border-radius: 20px;
    }

.max-entries-reached {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.no-entries-message {
    color: #888;
    font-style: italic;
    padding: 0.5rem 0;
}

.no-entries-available {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 1rem;
}

    .no-entries-available p {
        margin-bottom: 1rem;
        color: #666;
    }

/* ==========================================
   ENTRIES TABLE
   ========================================== */
.entries-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

    .entries-table th,
    .entries-table td {
        padding: 0.85rem 1.25rem;
        text-align: left;
        border-bottom: 1px solid #e9ecef;
    }

    .entries-table th {
        background: #f8f9fa;
        font-weight: 600;
        color: #333;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .entries-table tbody tr:hover {
        background: #f8f9fa;
    }

    .entries-table .my-entry-row {
        background: linear-gradient(135deg, #f0f9f0 0%, #e8f5e9 100%);
    }

        .entries-table .my-entry-row:hover {
            background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
        }

.my-entry-badge {
    display: inline-block;
    background: #2c5530;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ==========================================
   GROUP ENTRIES TABLE (Leaderboard Style)
   ========================================== */
.group-entries-table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.group-entries-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

    .group-entries-table th,
    .group-entries-table td {
        padding: 0.85rem 1.25rem;
        text-align: left;
        border-bottom: 1px solid #e9ecef;
    }

    .group-entries-table th {
        background: linear-gradient(135deg, #2c5530 0%, #3d7344 100%);
        font-weight: 600;
        color: #fff;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .group-entries-table tbody tr {
        transition: background 0.2s ease;
    }

        .group-entries-table tbody tr:hover {
            background: #f8f9fa;
        }

        .group-entries-table tbody tr:last-child td {
            border-bottom: none;
        }

    .group-entries-table .my-entry-row {
        background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    }

        .group-entries-table .my-entry-row:hover {
            background: linear-gradient(135deg, #d4edda 0%, #b8d9b8 100%);
        }

    .group-entries-table .rank-cell {
        width: 60px;
        font-weight: 700;
        color: #2c5530;
        text-align: center;
    }

    .group-entries-table .entry-name-cell {
        font-weight: 500;
    }

    .group-entries-table .owner-cell {
        color: #666;
    }

    .group-entries-table .score-cell {
        font-weight: 600;
        color: #2c5530;
        text-align: right;
    }

/* ==========================================
   MEMBERS GRID
   ========================================== */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* ==========================================
   MEMBERS LIST
   ========================================== */
.members-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .member-card:hover {
        background: #f0f0f0;
        transform: translateY(-1px);
    }

    .member-card.is-me {
        background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
        border-left: 4px solid #2c5530;
    }

.member-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2c5530 0%, #3d7344 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.member-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: #333;
}

.owner-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.you-tag {
    background: #2c5530;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.member-joined {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.15rem;
}

/* ==========================================
   INVITES PAGE
   ========================================== */
.tribal-survival-invites-page,
.tribal-survival-public-groups-page,
.tribal-survival-settings-page,
.tribal-survival-invite-page {
    padding: 2rem 0 3rem;
    min-height: 60vh;
    background: linear-gradient(to bottom, #f8faf8 0%, #ffffff 100%);
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c5530;
    margin: 0;
}

.page-subtitle {
    color: #666;
    margin: 0.5rem 0 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.no-invites-message {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

    .no-invites-message h3 {
        color: #333;
        margin-bottom: 0.75rem;
    }

    .no-invites-message p {
        color: #666;
        margin-bottom: 1.5rem;
    }

    .no-invites-message .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        min-height: auto;
        line-height: 1.5;
    }

.no-invites-icon {
    font-size: 4rem;
    color: #2c5530;
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.invites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invite-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

    .invite-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

    .invite-card.accepted {
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        border-color: #c3e6cb;
    }

    .invite-card.fade-out {
        opacity: 0;
        transform: translateX(-20px);
    }

.invite-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

    .invite-header h4 {
        margin: 0;
        font-size: 1.15rem;
        color: #333;
    }

.invite-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-item {
    font-size: 0.9rem;
    color: #666;
}

.invite-actions {
    display: flex;
    gap: 0.5rem;
}

.invite-accepted {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #155724;
    font-weight: 500;
}

    .invite-accepted i {
        font-size: 2rem;
        color: #28a745;
    }

/* ==========================================
   PUBLIC GROUPS PAGE
   ========================================== */
.search-section {
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
}

    .search-input-group .form-control {
        flex: 1;
        border-radius: 8px;
        padding: 0.65rem 1rem;
    }

    .search-input-group .btn {
        border-radius: 8px;
        padding: 0.65rem 1.25rem;
    }

.results-header {
    margin-bottom: 1.25rem;
    color: #666;
    font-size: 0.95rem;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.public-group-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

    .public-group-card:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

    .group-card-header h3 {
        font-size: 1.15rem;
        margin: 0;
        color: #333;
        font-weight: 600;
    }

.member-badge {
    background: #d4edda;
    color: #155724;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.public-group-card .group-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
    color: #666;
    line-height: 1.5;
}

.group-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

    .group-stats .stat {
        font-size: 0.85rem;
        color: #666;
        background: #f8f9fa;
        padding: 0.3rem 0.6rem;
        border-radius: 4px;
    }

.group-owner {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

    .group-owner i {
        color: #ffc107;
    }

.group-card-footer {
    margin-top: auto;
}

    .group-card-footer .btn {
        width: 100%;
    }

.no-groups-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

    .no-groups-found i {
        font-size: 4rem;
        color: #2c5530;
        opacity: 0.3;
        display: block;
        margin-bottom: 1.5rem;
    }

    .no-groups-found p {
        margin-bottom: 1.5rem;
        color: #666;
    }

    .no-groups-found .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        min-height: auto;
        line-height: 1.5;
    }

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.page-info {
    color: #666;
    font-weight: 500;
}

.loading,
.error-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

    .error-message i {
        font-size: 3rem;
        color: #dc3545;
        margin-bottom: 1.5rem;
        display: block;
    }

/* ==========================================
   SETTINGS PAGE
   ========================================== */
.settings-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

    .settings-section h2 {
        font-size: 1.25rem;
        font-weight: 600;
        color: #333;
        margin: 0 0 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #e9ecef;
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

        .settings-section h2 i {
            color: #2c5530;
        }

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.settings-form .form-control {
    border-radius: 8px;
    padding: 0.65rem 1rem;
}

    .settings-form .form-control:focus {
        border-color: #2c5530;
        box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.15);
    }

.form-actions {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.members-management-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s ease;
}

    .member-row:hover {
        background: #f0f0f0;
    }

    .member-row.is-owner {
        background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    }

    .member-row .member-info {
        display: flex;
        flex-direction: column;
    }

    .member-row .member-name {
        font-weight: 500;
        color: #333;
    }

    .member-row .member-joined {
        font-size: 0.8rem;
        color: #888;
    }

    .member-row .member-actions {
        display: flex;
        gap: 0.5rem;
    }

.invite-link-section {
    max-width: 600px;
}

.invite-code-display label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* ==========================================
   DANGER ZONE
   ========================================== */
.danger-zone {
    border-color: #f8d7da;
    background: #fff5f5;
}

    .danger-zone h2 {
        color: #dc3545;
        border-bottom-color: #f8d7da;
    }

        .danger-zone h2 i {
            color: #dc3545;
        }

.danger-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f8d7da;
}

.danger-info strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #333;
}

.danger-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* ==========================================
   INVITE PAGE
   ========================================== */
.invite-page-content {
    max-width: 800px;
    margin: 0 auto;
}

.group-name-header {
    font-size: 1.5rem;
    color: #2c5530;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 3px solid #2c5530;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.invite-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

    .invite-section:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }

    .invite-section h3 {
        font-size: 1.15rem;
        font-weight: 600;
        margin: 0 0 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #333;
    }

        .invite-section h3 i {
            color: #2c5530;
            font-size: 1.1rem;
        }

.section-description {
    color: #666;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.invite-link-box {
    max-width: 100%;
}

    .invite-link-box .input-group {
        display: flex;
        gap: 0;
    }

    .invite-link-box .form-control {
        border-radius: 8px 0 0 8px;
        border-right: none;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        background: #f8f9fa;
    }

        .invite-link-box .form-control:focus {
            background: #fff;
            border-color: #2c5530;
            box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.15);
        }

    .invite-link-box .btn {
        border-radius: 0 8px 8px 0;
        padding: 0.75rem 1.25rem;
        white-space: nowrap;
    }

.user-search-box {
    position: relative;
}

    .user-search-box .search-input-group {
        position: relative;
        max-width: 100%;
    }

    .user-search-box .form-control {
        padding: 0.75rem 1rem;
        padding-right: 2.5rem;
        border-radius: 8px;
        width: 100%;
    }

        .user-search-box .form-control:focus {
            border-color: #2c5530;
            box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.15);
        }

    .user-search-box .search-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #888;
        pointer-events: none;
    }

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.search-loading,
.no-results,
.search-error {
    padding: 1.25rem;
    text-align: center;
    color: #666;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

    .search-result-item:hover {
        background: #f8f9fa;
    }

    .search-result-item:last-child {
        border-bottom: none;
    }

    .search-result-item.is-member,
    .search-result-item.has-invite {
        background: #f8f9fa;
    }

    .search-result-item .user-info {
        display: flex;
        flex-direction: column;
    }

    .search-result-item .user-name {
        font-weight: 500;
        color: #333;
    }

    .search-result-item .user-username {
        font-size: 0.85rem;
        color: #888;
    }

.member-status,
.invite-status {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 500;
}

.pending-invites-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pending-invite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .pending-invite-item:hover {
        background: #f8f9fa;
        border-color: #ddd;
    }

    .pending-invite-item .invite-info {
        display: flex;
        flex-direction: column;
    }

    .pending-invite-item .invitee-name {
        font-weight: 500;
        color: #333;
    }

    .pending-invite-item .invite-date {
        font-size: 0.8rem;
        color: #888;
        margin-top: 0.15rem;
    }

.no-pending {
    color: #888;
    font-style: italic;
    padding: 0.75rem 0;
}

.current-members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #c8e6c9;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c5530;
    transition: all 0.2s ease;
}

    .member-chip:hover {
        background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
        transform: translateY(-1px);
    }

    .member-chip i {
        color: #2c5530;
    }

    .member-chip .owner-badge {
        color: #ffc107;
        font-size: 0.85rem;
    }

/* ==========================================
   TOAST MESSAGES
   ========================================== */
.toast-message {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

    .toast-message.show {
        transform: translateY(0);
        opacity: 1;
    }

    .toast-message.toast-success {
        background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    }

    .toast-message.toast-error {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    }

/* ==========================================
   CUSTOM MODALS
   ========================================== */
.ts-modal {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ts-modal-header {
    background: linear-gradient(135deg, #2c5530 0%, #3d7344 100%);
    color: #fff;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.ts-modal-header-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.ts-modal-header .modal-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .ts-modal-header .modal-title i {
        font-size: 1.1rem;
    }

.ts-modal-body {
    padding: 1.75rem 1.5rem;
    background: #fff;
}

    .ts-modal-body .form-label {
        font-weight: 600;
        color: #333;
        margin-bottom: 0.5rem;
    }

    .ts-modal-body .form-control,
    .ts-modal-body .form-select {
        border-radius: 10px;
        border: 2px solid #e9ecef;
        padding: 0.75rem 1rem;
        transition: all 0.2s ease;
    }

        .ts-modal-body .form-control:focus,
        .ts-modal-body .form-select:focus {
            border-color: #2c5530;
            box-shadow: 0 0 0 4px rgba(44, 85, 48, 0.15);
        }

    .ts-modal-body .form-control-lg,
    .ts-modal-body .form-select-lg {
        font-size: 1rem;
    }

.ts-toggle-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    margin-top: 0.5rem;
}

.ts-toggle-info {
    display: flex;
    flex-direction: column;
}

.ts-toggle-label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.ts-toggle-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.15rem;
}

.ts-toggle-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

    .ts-toggle-input:checked {
        background-color: #2c5530;
        border-color: #2c5530;
    }

    .ts-toggle-input:focus {
        box-shadow: 0 0 0 4px rgba(44, 85, 48, 0.15);
    }

.ts-modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
}

    .ts-modal-footer .btn {
        padding: 0.6rem 1.5rem;
        border-radius: 8px;
        font-weight: 500;
    }

    .ts-modal-footer .btn-lg {
        padding: 0.75rem 2rem;
    }

/* ==========================================
   ERROR & LOADING CONTAINERS
   ========================================== */
.error-container {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff5f5;
    border: 1px solid #f8d7da;
    border-radius: 12px;
}

    .error-container i {
        font-size: 4rem;
        color: #dc3545;
        margin-bottom: 1.5rem;
    }

.loading-container {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

    .loading-container i {
        font-size: 2rem;
        margin-bottom: 1rem;
        display: block;
        color: #2c5530;
    }

/* ==========================================
   BUTTONS - ENHANCED
   ========================================== */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2c5530;
    border-color: #2c5530;
}

    .btn-primary:hover {
        background: #1a3a1e;
        border-color: #1a3a1e;
    }

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

    .btn-success:hover {
        background: #218838;
        border-color: #218838;
    }

.btn-outline-primary {
    color: #2c5530;
    border-color: #2c5530;
}

    .btn-outline-primary:hover {
        background: #2c5530;
        color: #fff;
    }

.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}

    .btn-outline-success:hover {
        background: #28a745;
        color: #fff;
    }

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

    .btn-outline-danger:hover {
        background: #dc3545;
        color: #fff;
    }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 992px) {
    .ts-hero-banner {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .ts-hero-banner {
        height: 180px;
    }

    .ts-groups-content {
        padding: 1rem;
    }

    .page-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .groups-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons-left,
    .action-buttons-right {
        justify-content: center;
    }

    .group-header {
        flex-direction: column;
    }

    .group-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .invite-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .invite-actions {
        width: 100%;
    }

        .invite-actions .btn {
            flex: 1;
        }

    .danger-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .member-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

        .member-row .member-actions {
            width: 100%;
        }

    .groups-grid {
        grid-template-columns: 1fr;
    }

    .members-list {
        grid-template-columns: 1fr;
    }

    .group-meta {
        gap: 0.75rem;
    }

    .meta-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }

    .invite-page-content {
        max-width: 100%;
    }

    .invite-section {
        padding: 1.25rem;
    }

    .invite-link-box .input-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .invite-link-box .form-control {
        border-radius: 8px;
        border-right: 1px solid #ced4da;
    }

    .invite-link-box .btn {
        border-radius: 8px;
        width: 100%;
    }

    .pending-invite-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

        .pending-invite-item .btn {
            width: 100%;
        }
}

@media (max-width: 480px) {
    .ts-hero-banner {
        height: 150px;
    }

    .groups-tabs .nav-link {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .group-name-header {
        font-size: 1.25rem;
    }
}
