/* Accordion Grouped Display - Horizontal Ticket Layout */

.accordion-instant-wins {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Group Accordion Items */
.group-accordion-item {
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #ffffff;
    transition: all 0.3s ease;
}

.group-accordion-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Group Headers */
.group-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    border: 2px solid #3498db;
    border-radius: 16px;
    background: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    min-height: 70px;
}

.group-header:hover {
    background: #f8f9ff;
}

.group-header.expanded {
    background: #ffffff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 20px 25px;
}

/* Group Icons */
.group-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.group-icon-placeholder {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 8px;
    background: #666666;
    flex-shrink: 0;
}

/* Group Info */
.group-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-main-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.group-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 2px 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.group-header.expanded .group-title {
    font-size: 22px;
    margin-bottom: 5px;
}

.group-stats {
    font-size: 14px;
    color: #666666;
    margin: 0;
    font-weight: 500;
}

.group-header.expanded .group-stats {
    font-size: 16px;
    color: #7f8c8d;
}

/* Collapsed state toggle */
.group-header:not(.expanded) .group-toggle {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
}

.group-header:not(.expanded) .toggle-arrow {
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

/* Expanded Header Controls - Inline with group info */
.group-expanded-controls {
    display: none; /* Hidden by default */
    margin-left: 20px;
}

.group-header.expanded .group-expanded-controls {
    display: block;
}

.group-controls-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Header Tabs - Only in expanded state */
.group-header-tabs {
    display: flex;
    gap: 0;
    background: #f0f0f0;
    border: 2px solid #000000;
    border-radius: 25px;
    overflow: hidden;
    padding: 0;
}

.header-tab-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: bold;
    color: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

.header-tab-btn:hover {
    background: rgba(52, 152, 219, 0.1);
}

.header-tab-btn.active {
    background: #3498db;
    color: #ffffff;
}

/* Toggle Arrow */
.group-toggle {
    margin-left: 15px;
    padding: 0;
}

.group-header.expanded .group-toggle {
    background: #f1c40f;
    border: 2px solid #000000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
}

.toggle-arrow {
    font-size: 14px;
    color: #000000;
    transition: transform 0.3s ease;
    display: inline-block;
    font-weight: bold;
}

.group-header.expanded .toggle-arrow {
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

/* Group Content - Simplified since tabs moved to header */
.group-content {
    border-top: 1px solid #e8ecef;
    background: #ffffff;
    padding: 25px;
}

/* Tab Content - No tab buttons anymore */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Tickets Grid - Updated for horizontal layout */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 250px);
    gap: 15px;
    margin-bottom: 20px;
}

/* Ticket Item - Horizontal Layout */
.ticket-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: #ffffff;
    border: 2px solid #e8ecef;
    transition: all 0.3s ease;
    min-height: 100px;
}

.ticket-item.available {
    border-color: #e8ecef;
    background: #ffffff;
}

.ticket-item.available:hover {
    border-color: #3498db;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.ticket-item.won {
    border-color: #bdc3c7;
    background: #f8f9fa;
    opacity: 0.6;
    color: #95a5a6;
}

/* Hide tickets that don't match search */
.ticket-item.hidden {
    display: none;
}

/* Ticket Image Section - Left Side */
.ticket-image-section {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticket-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.ticket-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #bdc3c7;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Ticket Details Section - Right Side */
.ticket-details-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.ticket-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 5px 0;
    line-height: 1;
}

.ticket-item.won .ticket-number {
    color: #95a5a6;
}

.ticket-prize {
    font-size: 16px;
    color: #27ae60;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.ticket-item.won .ticket-prize {
    color: #95a5a6;
}

.ticket-status {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.ticket-item.won .ticket-status {
    color: #95a5a6;
}

/* Description Content */
.group-description-content {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.group-description-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Load More Button */
.load-more-container {
    padding-top: 20px;
    border-top: 1px solid #e8ecef;
}

.load-more-tickets-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.load-more-tickets-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.load-more-tickets-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading States */
.loading-tickets {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
    grid-column: 1 / -1;
}

.no-tickets {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.no-search-results {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    grid-column: 1 / -1;
    font-style: italic;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    background: #fdf2f2;
    border-radius: 8px;
    border: 1px solid #fadbd8;
    grid-column: 1 / -1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tickets-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .group-header {
        padding: 18px 20px;
    }
    
    .group-title {
        font-size: 20px;
    }
    
    .group-stats {
        font-size: 15px;
    }
    
    .header-tab-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .group-search-input {
        min-width: 150px;
        font-size: 13px;
    }
    
    .ticket-image-section {
        width: 70px;
        height: 70px;
        margin-right: 12px;
    }
    
    .ticket-number {
        font-size: 20px;
    }
    
    .ticket-prize {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .accordion-instant-wins {
        padding: 15px 10px;
    }
    
    .tickets-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ticket-item {
        padding: 12px;
        min-height: 80px;
    }
    
    .ticket-image-section {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }
    
    .ticket-number {
        font-size: 18px;
    }
    
    .ticket-prize {
        font-size: 13px;
    }
    
    .ticket-status {
        font-size: 10px;
    }
    
    .group-header {
        padding: 15px 18px;
    }
    
    .group-title {
        font-size: 18px;
    }
    
    .group-stats {
        font-size: 14px;
    }
    
    .group-icon,
    .group-icon-placeholder {
        width: 50px;
        height: 50px;
        margin-right: 15px;
    }
    
    .group-controls-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .group-search-input {
        min-width: 100%;
        width: 100%;
    }
    
    .header-tab-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .group-content {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .tickets-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .ticket-item {
        padding: 10px;
        min-height: 70px;
    }
    
    .ticket-image-section {
        width: 50px;
        height: 50px;
        margin-right: 8px;
    }
    
    .ticket-number {
        font-size: 16px;
    }
    
    .ticket-prize {
        font-size: 12px;
    }
    
    .group-accordion-item {
        margin-bottom: 15px;
    }
    
    .group-header {
        padding: 12px 15px;
    }
    
    .group-title {
        font-size: 16px;
    }
    
    .group-stats {
        font-size: 13px;
    }
    
    .group-content {
        padding: 15px 10px;
    }
    
    .header-tab-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 50px;
    }
}

/* Animation for smooth expand/collapse */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 1000px;
    }
    to {
        opacity: 0;
        max-height: 0;
    }
}

/* Highlight effect for expanded groups */
.group-accordion-item:has(.group-content:visible) .group-header {
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9ff 100%);
}

/* Enhanced styling for expanded group headers */
.group-header.expanded {
    border-color: #3498db !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9ff 100%) !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

/* Ensure expanded content has proper border radius */
.group-accordion-item:has(.group-content:visible) .group-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.group-accordion-item:has(.group-content:visible) .group-content {
    border-top: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Alternative for browsers that don't support :has() */
.group-accordion-item.expanded .group-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9ff 100%);
}

.group-accordion-item.expanded .group-content {
    border-top: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}
