/* ============================================================
   GROUPS BROWSE PAGE
   ============================================================ */

/* Hero Section */
.groups-hero {
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto 40px;
}

.groups-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.hero-description {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 8px;
}

.hero-link {
    color: #11b9a2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.hero-link:hover {
    color: #2a9b8f;
    text-decoration: underline;
}

.create-group-link {
    display: inline-block;
    margin-top: 8px;
}

/* Featured Groups Section */
.featured-groups-section {
    padding: 20px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
}

.featured-groups-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Featured Group Card */
.featured-group-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.featured-group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.featured-group-cover {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.featured-group-info {
    padding: 16px;
}

.featured-group-info .group-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.featured-group-info .group-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.featured-group-info .group-title a:hover {
    color: #11b9a2;
}

.featured-group-info .group-stats {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.featured-group-info .group-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-group-info .btn-join-group,
.featured-group-info .btn-joined {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.featured-group-info .btn-join-group {
    background: linear-gradient(135deg, #2a9b8f 0%, #3aab9f 50%, #4abfb3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(42, 155, 143, 0.3);
}

.featured-group-info .btn-join-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 155, 143, 0.4);
}

.featured-group-info .btn-joined {
    background: #10b981;
    color: white;
    cursor: default;
}

/* Search & Filters */
.groups-controls {
    max-width: 700px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.search-container {
    margin-bottom: 16px;
}

.group-search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
}

.group-search-input:focus {
    outline: none;
    border-color: #11b9a2;
    box-shadow: 0 0 0 3px rgba(17, 185, 162, 0.1);
}

.filters-container {
    display: flex;
    gap: 12px;
}

.filter-select {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #11b9a2;
}

/* Groups Section */
.groups-section {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

/* Groups Grid */
.groups-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* Group Card */
.group-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.group-card:hover {
    border-color: #11b9a2;
    box-shadow: 0 8px 16px rgba(17, 185, 162, 0.2);
    transform: translateY(-3px);
}

/* Group Cover Photo */
.group-cover {
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    position: relative;
}

.group-cover .featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

/* Group Info */
.group-info {
    padding: 16px;
    flex: 1;
}

.group-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.group-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.group-title a:hover {
    color: #11b9a2;
}

.group-stats {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.group-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.group-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
}

.btn-expand-description {
    background: none;
    border: none;
    color: #11b9a2;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.2s ease;
    display: inline;
    vertical-align: baseline;
}

.btn-expand-description:hover {
    color: #0e9281;
    text-decoration: underline;
}

.btn-expand-description.expanded {
    color: #6b7280;
}

.btn-expand-description.expanded:hover {
    color: #4b5563;
}

/* Group Keywords - Hidden by default on browse page */
.group-keywords {
    display: none;
}

/* Group Meta */
.group-meta {
    font-size: 12px;
    color: #9ca3af;
}

.group-creator {
    font-weight: 500;
}

/* Group Actions */
.group-actions {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
}

.btn-join-group,
.btn-joined,
.btn-pending {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-join-group {
    background: linear-gradient(135deg, #2a9b8f 0%, #3aab9f 50%, #4abfb3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(42, 155, 143, 0.3);
}

.btn-join-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 155, 143, 0.4);
}

.btn-join-group:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-joined {
    background: #10b981;
    color: white;
    cursor: default;
}

.btn-pending {
    background: #f59e0b;
    color: white;
    cursor: default;
}

/* Load More Container */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.load-more-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #2a9b8f 0%, #3aab9f 50%, #4abfb3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(42, 155, 143, 0.3);
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 155, 143, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 20px;
}

.btn-create-group {
    display: inline-block;
    padding: 12px 24px;
    background: #1bcdb6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-create-group:hover {
    background: #15b8a4;
}

/* Group Detail Page Feed Tab */
.tab-content#feed-tab {
    padding: 0 !important;
    margin: 0 auto !important;
}

#meme-grid {
    margin: 0 auto !important;
    padding: 0 20px !important;
    max-width: 700px !important;
}

/* Reset meme card margins within group feed */
#meme-grid .meme-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
    }
    
    .tab-content#feed-tab {
        padding: 0 !important;
    }
    
    #meme-grid {
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    /* Reset meme card margins on mobile */
    #meme-grid .meme-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    .groups-hero {
        padding: 16px 12px !important;
        margin-bottom: 16px !important;
    }
    
    .groups-hero h1 {
        font-size: 22px !important;
    }
    
    .hero-description {
        font-size: 14px !important;
    }
    
    .featured-groups-section {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .featured-groups-carousel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }
    
    .groups-controls {
        padding: 0 12px;
    }
    
    .group-search-input {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .filters-container {
        flex-direction: column;
    }
    
    .filter-select {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .groups-section {
        padding: 0 12px;
        margin-left: 0;
    }
    
    .groups-grid {
        gap: 12px;
    }
    
    .group-card {
        border-radius: 8px;
    }
    
    .group-cover {
        height: 180px;
    }
    
    .featured-group-cover {
        height: 160px;
    }
    
    .group-info {
        padding: 12px;
    }
    
    .group-title {
        font-size: 17px;
    }
    
    .group-stats {
        font-size: 12px;
        gap: 8px;
    }
    
    .group-description {
        font-size: 13px;
    }
    
    .keyword-tag {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .group-actions {
        padding: 12px;
    }
    
    .btn-join-group,
    .btn-joined,
    .btn-pending {
        padding: 8px 20px;
        font-size: 13px;
        min-width: 100px;
    }
    
    /* GROUP DETAIL PAGE - MOBILE TIGHTENING */
    /* Force cover photo to be full-width edge-to-edge */
    body .group-cover {
        margin: 0 !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        height: 150px !important;
        position: relative;
        left: 50%;
        right: 50%;
        transform: translateX(-50%);
    }
    
    body .group-cover img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    /* Eliminate gap between cover and group info */
    body .group-info {
        padding: 4px 16px 6px 16px !important;
        margin: 0 !important;
        margin-top: -3px !important;
    }
    
    body .group-info h1 {
        font-size: 18px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }
    
    body .group-stats {
        font-size: 12px !important;
        margin: 3px 0 5px 0 !important;
        padding: 0 !important;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .featured-groups-carousel {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Styles */
@media (min-width: 1025px) {
    .featured-groups-carousel {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   CREATE GROUP FORM STYLES
   ============================================================ */

/* Form Labels */
.label-hint {
    color: #9ca3af;
    font-weight: 400;
    font-size: 14px;
}

.input-hint {
    font-size: 14px;
    color: #6b7280;
    margin-top: 6px;
    margin-bottom: 0;
}

.char-counter-text {
    font-size: 14px;
    color: #6b7280;
    text-align: right;
    margin-top: 6px;
    margin-bottom: 0;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.radio-option input[type="radio"] {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked {
    accent-color: #667eea;
}

.radio-option:has(input:checked) {
    border-color: #667eea;
    background: #eff6ff;
}

.radio-content {
    flex: 1;
}

.radio-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.radio-description {
    font-size: 14px;
    color: #6b7280;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-option:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.checkbox-option input[type="checkbox"] {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"]:checked {
    accent-color: #667eea;
}

.checkbox-option:has(input:checked) {
    border-color: #667eea;
    background: #eff6ff;
}

.checkbox-content {
    flex: 1;
}

.checkbox-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.checkbox-description {
    font-size: 14px;
    color: #6b7280;
}

/* Mobile adjustments for form elements */
@media (max-width: 768px) {
    .radio-option,
    .checkbox-option {
        padding: 12px;
    }
    
    .radio-title,
    .checkbox-title {
        font-size: 15px;
    }
    
    .radio-description,
    .checkbox-description {
        font-size: 13px;
    }
}

/* ============================================================
   KEYWORD/TAG PILLS (Match upload.html blue pill style)
   ============================================================ */

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-item {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 9999px; /* Full rounded */
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tag-text {
    user-select: none;
}

.tag-remove {
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
    background: none;
    border: none;
    color: white;
}

.tag-remove:hover {
    color: #fca5a5;
}

/* ============================================================
   MY GROUPS PAGE STYLES
   ============================================================ */

/* Browse Button - teal color scheme */
.btn-browse {
    background: white !important;
    color: #11b9a2 !important;
    border: 2px solid #11b9a2 !important;
}

.btn-browse:hover {
    background: #f0fdf9 !important;
    border-color: #2a9b8f !important;
}

/* Tab styles - teal active state */
.tab-btn:hover {
    color: #11b9a2 !important;
}

.tab-btn.active {
    color: #11b9a2 !important;
    border-bottom-color: #11b9a2 !important;
}

/* Group item hover - teal */
.group-item:hover {
    border-color: #11b9a2 !important;
    box-shadow: 0 4px 12px rgba(17, 185, 162, 0.15) !important;
}

/* Group title hover - teal */
.group-item-title:hover {
    color: #11b9a2 !important;
}

/* View button - solid teal like Submit button */
.btn-view {
    background: #1bcdb6 !important;
    color: white !important;
}

.btn-view:hover {
    background: #15b8a4 !important;
}

/* Manage button hover - teal */
.btn-manage:hover {
    border-color: #11b9a2 !important;
    color: #11b9a2 !important;
}

/* ============================================================
   PENDING & REPORTED ITEMS STYLES
   ============================================================ */

/* Pending Item Container (Light Blue) */
.pending-item-container {
    background: #eff6ff;
    border: 2px solid #93c5fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(147, 197, 253, 0.2);
}

/* Reported Item Container (Light Red/Pink) */
.reported-item-container {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(252, 165, 165, 0.2);
}

/* Mobile optimization for containers */
@media (max-width: 768px) {
    .pending-item-container,
    .reported-item-container {
        padding: 12px 8px;
        margin-bottom: 16px;
        border-radius: 8px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .item-container-title {
        font-size: 16px;
        margin: 0 0 12px 0;
        padding: 0 8px 8px 8px;
    }
}

/* Container Title Headers */
.item-container-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Structured Report Details (Multi-Line) */
.report-details-compact {
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #ffc107;
}

.report-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.report-badge {
    background: #dc2626;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.report-time-compact {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
}

.report-line {
    color: #856404;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
    word-break: break-word;
}

.report-line:last-child {
    margin-bottom: 0;
}

.report-line strong {
    font-weight: 600;
    margin-right: 4px;
}

/* Meme card within reported item container */
.reported-item-container .meme-card {
    margin-bottom: 20px;
}

/* Approval buttons at bottom */
.reported-item-container .approval-buttons {
    margin-top: 0;
}
