/* Main Container */
.agl-account-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.agl-account-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 3rem;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.agl-account-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.1)" d="M0,0 L100,0 L100,100 Z" /></svg>');
    background-size: cover;
    opacity: 0.1;
}

.agl-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.agl-header-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0 0 2rem 0;
    line-height: 1.6;
    max-width: 600px;
}

/* Stats Summary */
.agl-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.agl-stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.agl-stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.25);
}

.agl-stat-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agl-stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.agl-stat-info {
    display: flex;
    flex-direction: column;
}

.agl-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.agl-stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Empty State */
.agl-empty-state {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px dashed #e0e7ff;
}

.agl-empty-icon {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

.agl-empty-icon svg {
    width: 40px;
    height: 40px;
    color: #667eea;
}

.agl-empty-title {
    font-size: 1.5rem;
    color: #333;
    margin: 0 0 1rem 0;
}

.agl-empty-text {
    color: #666;
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.agl-empty-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.agl-empty-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

/* Table Container */
.agl-table-container {
    background: white;
    border-radius: 20px;
    overflow: auto; /* Change from hidden to auto */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    position: relative;
}
/* Scrollbar Styling */
.agl-table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.agl-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.agl-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.agl-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
/* Table */
.agl-affiliate-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1200px; /* Keep minimum width for wide tables */
}

.agl-affiliate-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
}

.agl-affiliate-table th {
    padding: 1.5rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agl-affiliate-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.agl-affiliate-table tbody tr:hover {
    background: #f8fafc;
}

.agl-affiliate-table td {
    padding: 1.5rem;
    vertical-align: middle;
}

/* Product Cell */
.agl-product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agl-product-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.agl-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agl-product-details {
    flex: 1;
}

.agl-product-name {
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.agl-product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.agl-product-name a:hover {
    color: #667eea;
}

.agl-product-price {
    font-size: 0.9rem;
    color: #64748b;
}

/* Badges */
.agl-bonus-badge {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border: 2px solid #c7d2fe;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.agl-bonus-badge svg {
    width: 16px;
    height: 16px;
    color: #667eea;
}

.agl-bonus-count {
    color: #4f46e5;
    font-size: 1.1rem;
}

.agl-bonus-text {
    color: #6366f1;
    font-size: 0.9rem;
}

.agl-referral-count,
.agl-ticket-earned {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.agl-count-value,
.agl-ticket-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.agl-count-label,
.agl-ticket-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.agl-points-badge {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.agl-points-badge svg {
    width: 16px;
    height: 16px;
    color: #0ea5e9;
}

.agl-points-value {
    color: #0369a1;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Ticket Numbers */
.agl-ticket-numbers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agl-numbers-display {
    font-family: 'Courier New', monospace;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.agl-show-more {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-weight: 500;
    transition: color 0.2s ease;
}

.agl-show-more:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Link Actions */
.agl-link-actions {
    min-width: 300px;
}

.agl-link-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.agl-link-display {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease;
}

.agl-link-display:focus-within {
    border-color: #667eea;
    background: white;
}

.agl-link-icon {
    margin-right: 0.5rem;
    color: #64748b;
    display: flex;
    align-items: center;
}

.agl-link-icon svg {
    width: 16px;
    height: 16px;
}

.agl-affiliate-url {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.85rem;
    color: #334155;
    outline: none;
    font-family: 'Courier New', monospace;
    min-width: 0;
}

.agl-copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.agl-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.agl-copy-btn.agl-copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.agl-copy-icon svg {
    width: 14px;
    height: 14px;
}

.agl-link-share-buttons {
    display: flex;
    gap: 0.5rem;
}

.agl-share-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agl-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.agl-share-btn svg {
    width: 16px;
    height: 16px;
}

.agl-share-whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
}

.agl-share-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
}

.agl-share-twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
}

.agl-share-email:hover {
    background: #EA4335;
    border-color: #EA4335;
}

.agl-share-btn:hover svg {
    color: white;
}

/* Footer Note */
.agl-footer-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.agl-note-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.agl-footer-note p {
    margin: 0;
    color: #92400e;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Modal */
.agl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.agl-modal-overlay.show {
    display: flex;
}

.agl-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agl-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agl-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.agl-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.agl-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.agl-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Notification */
.agl-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.agl-notification.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .agl-table-container {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    .agl-affiliate-table {
        min-width: 1000px;
    }

    .agl-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .agl-account-container {
        padding: 1rem;
    }

    .agl-account-header {
        padding: 2rem 1.5rem;
    }

    .agl-main-title {
        font-size: 2rem;
    }

    .agl-stats-summary {
        grid-template-columns: 1fr;
    }

    .agl-link-input-group {
        flex-direction: column;
    }

    .agl-copy-btn {
        width: 100%;
        justify-content: center;
    }

    .agl-footer-note {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agl-table-row {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.agl-table-row:nth-child(1) { animation-delay: 0.1s; }
.agl-table-row:nth-child(2) { animation-delay: 0.2s; }
.agl-table-row:nth-child(3) { animation-delay: 0.3s; }
.agl-table-row:nth-child(4) { animation-delay: 0.4s; }
.agl-table-row:nth-child(5) { animation-delay: 0.5s; }


/* Fixed first column for better UX - OPTIONAL */
.agl-col-product {
    position: sticky;
    left: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    z-index: 2;
}

.agl-cell-product {
    position: sticky;
    left: 0;
    background: white;
    z-index: 1;
    min-width: 300px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

/* Column widths for better scrolling */
.agl-col-product { min-width: 300px; }
.agl-col-bonus { min-width: 120px; }
.agl-col-referrals { min-width: 120px; }
.agl-col-tickets { min-width: 140px; }
.agl-col-numbers { min-width: 200px; }
.agl-col-points { min-width: 100px; }
.agl-col-link { min-width: 350px; }

/* Scroll indicator - Add visual cue */
.agl-table-container::after {
    content: '↔';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.agl-table-container:hover::after {
    opacity: 0.3;
}

/* Table row hover with sticky column */
.agl-table-row:hover .agl-cell-product {
    background: #f8fafc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .agl-table-container {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    .agl-affiliate-table {
        min-width: 900px;
    }

    .agl-col-product { min-width: 250px; }
    .agl-col-link { min-width: 300px; }
}

/* Alternative: Make table responsive without horizontal scroll */
@media (max-width: 768px) {
    /* Optional: Stack table cells on mobile */
    .agl-table-responsive {
        display: block;
    }

    .agl-table-responsive thead {
        display: none;
    }

    .agl-table-responsive tbody,
    .agl-table-responsive tr,
    .agl-table-responsive td {
        display: block;
        width: 100%;
    }

    .agl-table-responsive tr {
        margin-bottom: 1rem;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        overflow: hidden;
    }

    .agl-table-responsive td {
        padding: 1rem;
        border-bottom: 1px solid #f1f5f9;
    }

    .agl-table-responsive td:last-child {
        border-bottom: none;
    }

    .agl-table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #475569;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}


/* Add these to your existing CSS */

/* Table Container Improvements */
.agl-table-container.agl-desktop-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.agl-affiliate-table {
    min-width: 1200px;
    width: 100%;
}

/* Responsive Table */
@media (max-width: 1024px) {
    .agl-affiliate-table {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    /* Hide desktop table on mobile */
    .agl-desktop-table {
        display: none;
    }

    /* Show mobile cards on mobile */
    .agl-mobile-cards {
        display: block;
    }

    .agl-table-container {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
}

@media (min-width: 769px) {
    /* Hide mobile cards on desktop */
    .agl-mobile-cards {
        display: none;
    }

    /* Show desktop table on desktop */
    .agl-desktop-table {
        display: block;
    }
}

/* Mobile Cards Styling */
.agl-mobile-cards {
    display: none;
}

.agl-responsive-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.agl-responsive-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.agl-card-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.agl-card-body {
    padding: 1.5rem;
}

.agl-card-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.agl-card-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.agl-row-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Scrollbar for Desktop */
.agl-table-container::-webkit-scrollbar {
    height: 10px;
}

.agl-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
    margin: 0 20px;
}

.agl-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

.agl-table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Scroll indicator */
.agl-table-container {
    position: relative;
}

.agl-table-container::after {
    content: '↔';
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.agl-table-container:hover::after {
    opacity: 0.7;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .agl-mobile-cards {
        display: grid;
        gap: 1.5rem;
    }

    .agl-responsive-card {
        margin-bottom: 0;
    }

    .agl-link-input-group {
        flex-direction: column;
    }

    .agl-copy-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .agl-link-share-buttons {
        justify-content: center;
        margin-top: 1rem;
    }

    .agl-share-btn {
        flex: 1;
        padding: 0.5rem;
        min-width: 60px;
    }

    .agl-share-text {
        display: none;
    }
}

/* Desktop table improvements */
@media (min-width: 769px) {
    .agl-affiliate-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .agl-affiliate-table th {
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .agl-cell-product {
        position: sticky;
        left: 0;
        background: white;
        z-index: 5;
        box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    }

    .agl-affiliate-table tbody tr:hover .agl-cell-product {
        background: #f8fafc;
    }
}

/* Fix for share buttons in table */
.agl-share-text {
    display: none;
}

@media (min-width: 1024px) {
    .agl-share-text {
        display: inline;
        margin-left: 0.25rem;
        font-size: 0.8rem;
    }

    .agl-share-btn {
        padding: 0.4rem 0.75rem;
    }
}