/* ═══════════════════════════════════════════════════════════
   GRUPURI.CSS - Stiluri pentru pagina de grupuri
   Design: DM Sans, Slate Blue (#475569) + Coral (#f97316)
   ═══════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* ═══════════════ NAVBAR ═══════════════ */
.main-nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.logo-apart { color: #475569; }
.logo-tu { color: #f97316; }
.logo-al { color: #475569; }

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #475569;
    border-bottom-color: #f97316;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-creeaza-grup {
    background: #f97316;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-creeaza-grup:hover {
    background: #ea580c;
}

.btn-login-nav {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login-nav:hover {
    color: #f97316;
}

.nav-user {
    position: relative;
}

.btn-user-avatar {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #475569;
    cursor: pointer;
    padding: 0.25rem;
}

.btn-user-avatar:hover {
    color: #f97316;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    display: none;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #f1f5f9;
    color: #f97316;
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
}

/* ═══════════════ HERO ═══════════════ */
.grupuri-hero {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    padding: 3rem 1.5rem;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.hero-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ═══════════════ FILTERS ═══════════════ */
.filters-section {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.filter-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #334155;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.filter-group select:focus {
    outline: none;
    border-color: #f97316;
}

.btn-filter-reset {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-filter-reset:hover {
    background: #e2e8f0;
    color: #475569;
}

/* ═══════════════ TEREN FILTER BANNER ═══════════════ */
.teren-filter-banner {
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    padding: 0.75rem 1.5rem;
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.banner-content i {
    color: #d97706;
}

.btn-clear-filter {
    margin-left: auto;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    color: #92400e;
    font-size: 0.8125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-clear-filter:hover {
    background: #fef9c3;
}

/* ═══════════════ MY GROUPS SECTION ═══════════════ */
.my-groups-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ═══════════════ MAIN CONTENT ═══════════════ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

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

.content-header h2 {
    font-size: 1.25rem;
    color: #475569;
}

.count-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ═══════════════ LOADING STATE ═══════════════ */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════ EMPTY STATE ═══════════════ */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #475569;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f97316;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #ea580c;
}

/* ═══════════════ GRUPURI GRID ═══════════════ */
.grupuri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ═══════════════ GRUP CARD ═══════════════ */
.grup-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

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

.grup-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.grup-card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.grup-card h3 {
    font-size: 1.125rem;
    color: #1e293b;
    font-weight: 600;
    margin: 0;
}

.grup-card h3 a {
    color: inherit;
    text-decoration: none;
}

.grup-card h3 a:hover {
    color: #f97316;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.status-activ {
    background: #dcfce7;
    color: #166534;
}

.status-explorare {
    background: #fef9c3;
    color: #854d0e;
}

.status-inchis {
    background: #fee2e2;
    color: #991b1b;
}

.status-arhivat {
    background: #f1f5f9;
    color: #64748b;
}

.grup-location {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.grup-card-body {
    padding: 1.25rem;
    flex: 1;
}

.grup-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grup-card-footer {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grup-stats {
    display: flex;
    gap: 1rem;
}

.grup-stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.grup-stat i {
    font-size: 0.875rem;
}

.activity-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.activity-recent {
    background: #dcfce7;
    color: #166534;
}

.activity-moderat {
    background: #fef9c3;
    color: #854d0e;
}

.activity-inactiv {
    background: #fee2e2;
    color: #991b1b;
}

.grup-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-vezi-grup {
    padding: 0.5rem 1rem;
    background: #475569;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-vezi-grup:hover {
    background: #334155;
}

.btn-alatura {
    padding: 0.5rem 1rem;
    background: #f97316;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-alatura:hover {
    background: #ea580c;
}

.btn-alatura:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Member badge for cards I'm in */
.member-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* ═══════════════ CTA SECTION ═══════════════ */
.cta-section {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    padding: 3rem 1.5rem;
    text-align: center;
    color: white;
    margin-top: 2rem;
}

.cta-content h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.cta-content p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f97316;
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-cta:hover {
    background: #ea580c;
}

/* ═══════════════ FOOTER ═══════════════ */
.main-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 3rem 1.5rem 1.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand p {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.footer-links h4 {
    color: white;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.footer-links a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.footer-links a:hover {
    color: #f97316;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 0.8125rem;
}

/* ═══════════════ TOAST ═══════════════ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #166534;
}

.toast.error {
    background: #991b1b;
}

.toast.info {
    background: #1e40af;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-mobile-toggle {
        display: block;
    }
    
    .nav-actions .btn-creeaza-grup {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .grupuri-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-clear-filter {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* ── MATCHING ── */
.grup-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
}
.grup-matching-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
    font-weight: 500;
}
.grup-matching-stack span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.matching-yes {
    color: #16a34a;
}
.matching-no {
    color: #9ca3af;
}
.matching-info {
    color: #475569;
    font-size: 0.75rem;
}

/* ── ADMIN BADGE ── */
.admin-badge {
    background: #f59e0b !important;
    color: #fff !important;
    border-color: #f59e0b !important;
}

/* ── PENDING BADGE ── */
.btn-pending {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.375rem;
    cursor: default;
}
