/* My Groups Page Styles */

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

:root {
    --primary-color: #7422FF;
    --secondary-color: #575756;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --group-color: #FF6B6B;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
    --bg-gray: #F9FAFB;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.logo-icon {
    font-size: 28px;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.mobile-menu-toggle {
    display: none;
}

/* Page Header */
.groups-page {
    padding: 30px 0 60px;
}

.page-header {
    margin-bottom: 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb i {
    font-size: 10px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 16px;
}

/* Groups Layout */
.groups-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Sidebar */
.account-sidebar {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-sm);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #9D5CFF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.user-info h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.user-info p {
    font-size: 13px;
    color: var(--text-light);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s;
}

.sidebar-nav a:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary-color), #9D5CFF);
    color: white;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.sidebar-nav a.logout {
    margin-top: 12px;
    color: var(--danger-color);
}

.sidebar-nav a.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Groups Content */
.groups-content {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(116, 34, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(116, 34, 255, 0.1);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-count {
    background: var(--bg-gray);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.tab-btn.active .tab-count {
    background: var(--primary-color);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Group Card */
.group-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    background: var(--white);
}

.group-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.group-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.group-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--group-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.group-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.group-status-badge.active {
    background: rgba(249, 115, 22, 0.9);
    color: white;
}

.group-status-badge.completed {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.group-status-badge.expired {
    background: rgba(107, 114, 128, 0.9);
    color: white;
}

.group-content {
    padding: 20px;
}

.group-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.group-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
}

/* Progress Bar */
.group-progress {
    margin-bottom: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-members {
    color: var(--text-dark);
    font-weight: 600;
}

.progress-needed {
    color: var(--text-light);
}

.progress-bar {
    height: 8px;
    background: var(--bg-gray);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #9D5CFF);
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* Countdown Timer */
.group-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-gray);
    border-radius: 8px;
    margin-bottom: 12px;
}

.countdown-icon {
    color: var(--warning-color);
}

.countdown-time {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.countdown-time.urgent {
    color: var(--danger-color);
}

/* Group Actions */
.group-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #6419E6;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-dark);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(116, 34, 255, 0.05);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    flex: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 24px;
}

.modal-body > p {
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Share Link */
.share-link {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-link input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 14px;
}

.share-link input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Share Options */
.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-btn {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.share-btn.whatsapp {
    border-color: #25D366;
    color: #25D366;
}

.share-btn.whatsapp:hover {
    background: #25D366;
    color: white;
}

.share-btn.facebook {
    border-color: #1877F2;
    color: #1877F2;
}

.share-btn.facebook:hover {
    background: #1877F2;
    color: white;
}

.share-btn.twitter {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.share-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
}

.share-btn.email {
    border-color: #EA4335;
    color: #EA4335;
}

.share-btn.email:hover {
    background: #EA4335;
    color: white;
}

/* Footer */
.main-footer {
    background: var(--text-dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.newsletter-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: 'Source Sans Pro', sans-serif;
}

.newsletter-form button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.newsletter-form button:hover {
    background: #6419E6;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.payment-methods {
    display: flex;
    gap: 12px;
    font-size: 24px;
}

.payment-methods i {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.payment-methods i:hover {
    opacity: 1;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-dark);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.toast.show {
    display: flex;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .groups-layout {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: static;
    }

    .groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .tabs-container {
        gap: 4px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .groups-grid {
        grid-template-columns: 1fr;
    }

    .share-options {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .groups-content {
        padding: 16px;
    }

    .group-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
