/**
 * Social Groups Hub - Frontend Styles
 * Mobile-first, responsive, animated
 */

/* ========== VARIABLES ========== */
:root {
    --sgh-primary: #10b981;
    --sgh-primary-dark: #059669;
    --sgh-secondary: #6b7280;
    --sgh-platinum: #e5e4e2;
    --sgh-gold: #ffd700;
    --sgh-silver: #c0c0c0;
    --sgh-error: #ef4444;
    --sgh-success: #10b981;
    --sgh-warning: #f59e0b;
    --sgh-border: #e5e7eb;
    --sgh-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --sgh-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --sgh-radius: 12px;
    --sgh-transition: all 0.3s ease;
}

/* ========== GRID LAYOUTS ========== */
.sgh-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

@media (min-width: 768px) {
    .sgh-groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sgh-groups-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sgh-promoted-grid {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 32px;
    border-radius: var(--sgh-radius);
    margin-bottom: 48px;
}

/* ========== GROUP CARDS ========== */
.sgh-group-card {
    background: #fff;
    border-radius: var(--sgh-radius);
    overflow: hidden;
    box-shadow: var(--sgh-shadow);
    transition: var(--sgh-transition);
    position: relative;
}

.sgh-group-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sgh-shadow-lg);
}

.sgh-group-card.sgh-promoted {
    border: 2px solid var(--sgh-gold);
}

.sgh-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.sgh-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sgh-transition);
}

.sgh-group-card:hover .sgh-card-image img {
    transform: scale(1.05);
}

.sgh-default-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sgh-default-image .material-icons {
    font-size: 64px;
    color: rgba(255,255,255,0.8);
}

.sgh-card-content {
    padding: 20px;
}

.sgh-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sgh-platform-icon {
    color: var(--sgh-primary);
    font-size: 24px;
}

.sgh-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.sgh-card-title a {
    color: #1f2937;
    text-decoration: none;
    transition: var(--sgh-transition);
}

.sgh-card-title a:hover {
    color: var(--sgh-primary);
}

.sgh-card-category {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--sgh-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.sgh-card-category .material-icons {
    font-size: 16px;
}

.sgh-card-excerpt {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.sgh-card-stats {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--sgh-border);
    border-bottom: 1px solid var(--sgh-border);
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--sgh-secondary);
}

.sgh-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgh-card-stats .material-icons {
    font-size: 18px;
}

.sgh-card-actions {
    display: flex;
    gap: 8px;
}

/* ========== PROMOTION BADGES ========== */
.sgh-promotion-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: var(--sgh-shadow);
}

.sgh-promotion-badge .material-icons {
    font-size: 16px;
}

.sgh-badge-platinum {
    background: linear-gradient(135deg, #e5e4e2, #fff);
    color: #374151;
}

.sgh-badge-gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #92400e;
}

.sgh-badge-silver {
    background: linear-gradient(135deg, #c0c0c0, #e5e5e5);
    color: #374151;
}

/* ========== BUTTONS ========== */
.sgh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--sgh-transition);
    text-align: center;
    justify-content: center;
}

.sgh-btn .material-icons {
    font-size: 18px;
}

.sgh-btn-primary {
    background: var(--sgh-primary);
    color: #fff;
}

.sgh-btn-primary:hover {
    background: var(--sgh-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--sgh-shadow);
}

.sgh-btn-success {
    background: var(--sgh-success);
    color: #fff;
}

.sgh-btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.sgh-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.sgh-btn-secondary:hover {
    background: #e5e7eb;
}

.sgh-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.sgh-btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.sgh-btn-block {
    display: flex;
    width: 100%;
}

/* ========== FILTERS ========== */
.sgh-filters-bar {
    background: #fff;
    padding: 20px;
    border-radius: var(--sgh-radius);
    box-shadow: var(--sgh-shadow);
    margin-bottom: 32px;
}

.sgh-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.sgh-filters-form select {
    padding: 10px 16px;
    border: 1px solid var(--sgh-border);
    border-radius: 8px;
    font-size: 14px;
    min-width: 180px;
    background: #fff;
}

.sgh-clear-filters {
    padding: 10px 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

/* ========== SEARCH FORM ========== */
.sgh-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.sgh-search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--sgh-border);
    border-radius: 8px;
    font-size: 16px;
}

.sgh-search-input:focus {
    outline: none;
    border-color: var(--sgh-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ========== FORMS ========== */
.sgh-form {
    background: #fff;
    padding: 32px;
    border-radius: var(--sgh-radius);
    box-shadow: var(--sgh-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.sgh-form-group {
    margin-bottom: 24px;
}

.sgh-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.sgh-form-group input[type="text"],
.sgh-form-group input[type="url"],
.sgh-form-group input[type="email"],
.sgh-form-group select,
.sgh-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--sgh-border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.sgh-form-group input:focus,
.sgh-form-group select:focus,
.sgh-form-group textarea:focus {
    outline: none;
    border-color: var(--sgh-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sgh-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .sgh-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.sgh-form-note {
    text-align: center;
    color: var(--sgh-secondary);
    margin-top: 16px;
}

/* ========== DASHBOARD ========== */
.sgh-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.sgh-dashboard-card {
    background: #fff;
    border-radius: var(--sgh-radius);
    padding: 20px;
    box-shadow: var(--sgh-shadow);
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.sgh-card-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sgh-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgh-no-thumb {
    width: 100%;
    height: 100%;
    background: var(--sgh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgh-no-thumb .material-icons {
    font-size: 40px;
    color: rgba(255,255,255,0.8);
}

.sgh-card-info {
    flex: 1;
}

.sgh-card-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.sgh-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--sgh-secondary);
}

.sgh-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgh-card-meta .material-icons {
    font-size: 16px;
}

.sgh-promo-status {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-block;
}

.sgh-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== PROMOTION PACKAGES ========== */
.sgh-packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 32px 0;
}

@media (min-width: 768px) {
    .sgh-packages-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sgh-package-card {
    background: #fff;
    border-radius: var(--sgh-radius);
    padding: 32px;
    box-shadow: var(--sgh-shadow);
    text-align: center;
    transition: var(--sgh-transition);
    position: relative;
    overflow: hidden;
}

.sgh-package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.sgh-package-silver::before {
    background: linear-gradient(90deg, var(--sgh-silver), #e5e5e5);
}

.sgh-package-gold::before {
    background: linear-gradient(90deg, var(--sgh-gold), #ffed4e);
}

.sgh-package-platinum::before {
    background: linear-gradient(90deg, var(--sgh-platinum), #fff);
}

.sgh-package-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--sgh-shadow-lg);
}

.sgh-package-header .material-icons {
    font-size: 48px;
    color: var(--sgh-primary);
    margin-bottom: 16px;
}

.sgh-package-header h3 {
    font-size: 24px;
    margin: 0 0 16px 0;
}

.sgh-package-price {
    font-size: 48px;
    font-weight: 700;
    color: var(--sgh-primary);
    margin-bottom: 8px;
}

.sgh-currency {
    font-size: 24px;
    vertical-align: super;
}

.sgh-package-duration {
    color: var(--sgh-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.sgh-package-features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
}

.sgh-package-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
}

.sgh-package-features .material-icons {
    color: var(--sgh-success);
    font-size: 20px;
}

/* ========== PAYMENT INSTRUCTIONS ========== */
.sgh-bank-details-box {
    background: #f9fafb;
    border: 2px solid var(--sgh-border);
    border-radius: var(--sgh-radius);
    padding: 24px;
    margin: 24px 0;
}

.sgh-bank-details-box table {
    width: 100%;
    margin: 16px 0;
}

.sgh-bank-details-box th {
    text-align: left;
    padding: 8px;
    color: var(--sgh-secondary);
    font-weight: 600;
}

.sgh-bank-details-box td {
    padding: 8px;
    font-weight: 700;
}

.sgh-important {
    background: #fef2f2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-weight: 600;
}

/* ========== NOTICES ========== */
.sgh-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sgh-notice-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--sgh-success);
}

.sgh-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--sgh-error);
}

.sgh-notice-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--sgh-warning);
}

/* ========== PAGINATION ========== */
.sgh-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
}

.sgh-pagination a,
.sgh-pagination span {
    padding: 8px 12px;
    border: 1px solid var(--sgh-border);
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    transition: var(--sgh-transition);
}

.sgh-pagination a:hover {
    background: var(--sgh-primary);
    color: #fff;
    border-color: var(--sgh-primary);
}

.sgh-pagination .current {
    background: var(--sgh-primary);
    color: #fff;
    border-color: var(--sgh-primary);
}

/* ========== WIDGETS ========== */
.sgh-widget-groups {
    margin-bottom: 16px;
}

.sgh-widget-group-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sgh-border);
}

.sgh-widget-group-item:last-child {
    border-bottom: none;
}

.sgh-widget-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.sgh-widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgh-widget-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.sgh-widget-content a {
    text-decoration: none;
    color: #1f2937;
}

.sgh-widget-content a:hover {
    color: var(--sgh-primary);
}

.sgh-widget-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--sgh-secondary);
}

.sgh-widget-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    text-decoration: none;
    color: var(--sgh-primary);
    font-weight: 600;
    transition: var(--sgh-transition);
}

.sgh-widget-view-all:hover {
    background: var(--sgh-primary);
    color: #fff;
}

/* ========== EMPTY STATES ========== */
.sgh-empty-state {
    text-align: center;
    padding: 64px 32px;
}

.sgh-empty-state .material-icons {
    font-size: 80px;
    color: var(--sgh-secondary);
    opacity: 0.5;
    margin-bottom: 16px;
}

.sgh-no-results {
    text-align: center;
    padding: 48px 32px;
    color: var(--sgh-secondary);
}

/* ========== SECTION HEADINGS ========== */
.sgh-section-heading {
    font-size: 28px;
    font-weight: 700;
    margin: 32px 0 24px 0;
    color: #1f2937;
}

.sgh-promoted-section .sgh-section-heading {
    color: #fff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
    .sgh-groups-grid {
        grid-template-columns: 1fr;
    }
    
    .sgh-dashboard-card {
        flex-direction: column;
        text-align: center;
    }
    
    .sgh-card-actions {
        width: 100%;
    }
    
    .sgh-filters-form {
        flex-direction: column;
    }
    
    .sgh-filters-form select {
        width: 100%;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.sgh-group-card {
    animation: fadeIn 0.5s ease;
}

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

.sgh-btn:active {
    animation: pulse 0.3s ease;
}

/* ========== MODAL ========== */
.sgh-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgh-modal-content {
    background-color: #fff;
    padding: 32px;
    border-radius: var(--sgh-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sgh-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: var(--sgh-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--sgh-transition);
}

.sgh-modal-close:hover {
    color: var(--sgh-error);
}

.sgh-modal-content h2 {
    margin-top: 0;
    margin-bottom: 24px;
}

.sgh-report-message {
    padding: 12px;
    border-radius: var(--sgh-radius);
    margin-top: 16px;
}

.sgh-report-message.sgh-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.sgh-report-message.sgh-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.sgh-single-report {
    text-align: center;
    margin: 24px 0;
}

/* ========== VERIFICATION BADGE ========== */
.sgh-verified-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    z-index: 10;
}

.sgh-verified-badge .material-icons {
    font-size: 20px;
}

.sgh-verified-inline {
    color: #3b82f6;
    font-size: 20px !important;
    vertical-align: middle;
    margin-left: 4px;
}

.sgh-verified-group {
    border: 2px solid #3b82f6;
}

/* Info button color */
.sgh-btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.sgh-btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
}
