/* Active Ace Pots Widget - Modern Collapsible Styling */

.ace-pots-module {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Pot Totals Summary */
.pot-totals {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.total-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.total-label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1c40f;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.super-ace {
    background: rgba(255, 255, 255, 0.05);
    margin: 0.5rem -1rem -1rem -1rem;
    padding: 1rem;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.super-ace .total-amount {
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
    color: #e74c3c;
}

/* Toggle Button Styling */
.ace-pots-toggle {
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ace-pots-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.ace-pots-toggle:hover::before {
    left: 100%;
}

.ace-pots-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    transform: translateY(-1px);
}

.ace-pots-toggle .toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0.5rem;
}

.ace-pots-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.ace-pots-toggle[aria-expanded="true"] .toggle-text::after {
    content: " Less";
}

/* Section Divider */
.section-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0 1rem 0;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.divider-text {
    background: var(--ace-pot-bg, #1a1a1a);
    padding: 0 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Collapsible Content Animation */
.collapse {
    transition: all 0.3s ease-in-out;
}

.collapsing {
    transition: height 0.3s ease-in-out;
}

/* Individual Ace Pot Items */
.ace-pots-list {
    margin-top: 0;
}

.pot-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pot-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pot-content {
    flex: 1;
}

.pot-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.pot-header {
    flex: 1;
}

.pot-name {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.pot-progress {
    margin-bottom: 0.25rem;
}

.pot-progress .progress {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.pot-progress .progress-bar {
    background: linear-gradient(90deg, #f39c12, #e67e22);
    transition: width 0.3s ease;
}

.pot-progress small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.pot-amount {
    text-align: right;
    margin-left: 1rem;
}

.amount-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1c40f;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pot-info {
    margin-top: 0.5rem;
}

.start-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7) !important;
    display: flex;
    align-items: center;
}

.start-date i {
    color: rgba(255, 255, 255, 0.5) !important;
}

.pot-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.pot-link:hover {
    color: #f1c40f;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

/* No Pots Message */
.no-pots-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem 1rem;
    font-style: italic;
}

/* Header Improvements */
.pots-header .badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: none;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* Dark Mode Enhancements */
[data-bs-theme="dark"] {
    .pot-totals {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .super-ace {
        background: rgba(0, 0, 0, 0.4);
        border-top-color: rgba(255, 255, 255, 0.05);
    }

    .total-row:not(:last-child) {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .divider-text {
        background: #0f172a;
    }

    .section-divider::before {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }

    .pot-item {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .pot-item:hover {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .pot-progress .progress {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pot-details {
        flex-direction: column;
        align-items: flex-start;
    }

    .pot-amount {
        text-align: left;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .pot-item {
        padding: 0.75rem;
    }

    .pot-name {
        font-size: 0.9rem;
    }

    .amount-value {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .pots-header .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pots-header .badge {
        order: 3;
        flex-basis: 100%;
    }

    .pot-totals {
        padding: 0.75rem;
    }

    .total-amount {
        font-size: 1.1rem;
    }

    .section-divider {
        margin: 1rem 0;
    }

    .divider-text {
        font-size: 0.8rem;
        padding: 0 0.75rem;
    }
}

/* Animation for expanding/collapsing */
.collapse.show .pot-item {
    animation: slideIn 0.3s ease-out;
    animation-fill-mode: both;
}

.collapse.show .pot-item:nth-child(1) {
    animation-delay: 0.05s;
}

.collapse.show .pot-item:nth-child(2) {
    animation-delay: 0.1s;
}

.collapse.show .pot-item:nth-child(3) {
    animation-delay: 0.15s;
}

.collapse.show .pot-item:nth-child(4) {
    animation-delay: 0.2s;
}

.collapse.show .pot-item:nth-child(5) {
    animation-delay: 0.25s;
}