.account-container {
    display: grid;
    grid-template-areas:
        "account"
        "leagues"
        "usage";
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1rem;
    padding: clamp(0.75rem, 2vw, 2rem);
    width: 100%;
}

.main-content {
    background: var(--bg-primary) !important;
    overflow: visible !important; /* Let the document/body handle scrolling to match landing page */
}

.account-panel {
    flex: 2;
    background: var(--panel-bg);
    /* border: 1px solid var(--panel-border); */
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    grid-area: account;
}

.usage-panel {
    flex: 2;
    background: var(--panel-bg);
    /* border: 1px solid var(--panel-border); */
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    grid-area: usage;
}

.account-info {
    padding: 1.25rem;
    width: 100%;
    margin: 0 auto;
}

.user-email {
    font-size: 1.1rem;
    color: var(--panel-text);
    margin-bottom: 1.25rem;
}

.subscription-info {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--header-darker);
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    width: 250px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.subscription-tier h3 {
    color: var(--panel-text);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.tier-name {
    color: var(--accent-primary);
    font-size: 1.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.tier-price {
    color: var(--text-muted);
    font-size: 1rem;
    white-space: nowrap;
    margin-left: 0;
    line-height: 1.2;
}

.tier-description {
    color: var(--panel-text);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.tier-description:empty {
    display: none;
}

.tier-features {
    display: flex;
    flex-direction: column;
}

.tier-features ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.75rem;
}

.tier-features li {
    color: var(--panel-text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
}

.tier-features li.no-features-message {
    color: var(--text-muted);
    font-style: italic;
    gap: 0;
}

.tier-features li i.fas.fa-check-circle {
    color: var(--accent-green);
    font-size: 0.9rem;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 250px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.account-panel button {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #df3e3e;
}

.usage-info {
    padding: 2rem;
}

.usage-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--panel-text);
    margin-bottom: 1rem;
}

.usage-count {
    color: var(--text-muted);
}

.usage-bar-container {
    width: 100%;
    height: 8px;
    background: var(--header-darker);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.usage-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-message {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* League Management Section */
.leagues-panel {
    flex: 2;
    background: var(--panel-bg);
    /* border: 1px solid var(--panel-border); */
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    /* Add padding to the panel content for internal spacing */
    grid-area: leagues;
}

/* Tablet layout */
@media (min-width: 768px) {
    .account-container {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "account leagues"
            "usage  leagues";
    }
    .leagues-panel { height: auto; }

    /* Tighter desktop/tablet widths for subscription card and actions */
    .subscription-info,
    .account-actions {
        width: auto;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Desktop layout */
@media (min-width: 1200px) {
    .account-container {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas: "account usage leagues";
    }

    .subscription-info,
    .account-actions {
        max-width: 300px; /* smaller cap on large screens */
        margin-left: auto;
        margin-right: auto;
    }
}

/* Make inner blocks full-width only on small screens */
@media (max-width: 767px) {
    .subscription-info,
    .account-actions,
    .basic-information-section {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Make subscription card and button more compact on small screens */
    .subscription-info {
        padding: 1rem;
        max-width: 420px;
    }
    .account-actions {
        max-width: 420px;
        gap: 0.75rem;
    }
    .account-panel button {
        padding: 0.8rem;
    }
    .tier-name {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    }
}

/* Slightly fluid headings and paddings */
.panel-header h2 { 
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}
.usage-info { 
    padding: clamp(1rem, 2.5vw, 2rem);
}

/* League list tweaks on very small screens */
@media (max-width: 480px) {
    .league-item { align-items: flex-start; }
    .league-name { white-space: normal; }
}

.leagues-panel .panel-content {
    padding: 1.5rem; /* Add padding to the panel content area */
}

.leagues-list {
    margin-bottom: 1.5rem; /* Consistent margin */
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Space between league items */
}

.league-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background-color: var(--header-darker);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 1rem;
}

.league-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); /* Slightly enhanced hover shadow */
    border-color: var(--accent-primary); /* Highlight border on hover */
}

.league-platform {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-primary);
    background-color: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
}

.league-name {
    font-weight: 500;
    font-size: 1rem;
    color: var(--panel-text);
    flex-grow: 1;
    margin: 0 0.5rem;
    line-height: 1.4;
    text-align: left;
}

.leagues-panel .btn-delete-league {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem; /* Larger icon */
    cursor: pointer;
    padding: 0.5rem; /* Add some padding for easier clicking */
    border-radius: 50%; /* Make it circular */
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* Fixed width */
    height: 36px; /* Fixed height */
}

.leagues-panel .btn-delete-league:hover {
    color: var(--accent-red); /* Red color on hover for delete */
    background-color: var(--accent-red-transparent); /* Subtle red background on hover */
}

.leagues-panel .btn-delete-league i {
    line-height: 1; /* Ensure icon is centered */
}

.add-league-container {
    margin-top: 1.5rem; /* Add more space above */
    padding-bottom: 0.5rem; /* Add a little space at the bottom of the panel content */
}

#add-league-btn {
    width: 100%; /* Fill its container */
    padding: 0.75rem; /* Adjusted padding for full-width button */
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;

    /* New styles for a unique outline look */
    background-color: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

#add-league-btn:hover {
    background-color: rgba(37, 99, 235, 0.1); /* Light accent fill on hover */
    color: var(--accent-primary); /* Ensure text color remains on hover */
}

.empty-state, #empty-leagues { /* Apply styles to ID as well if it exists */
    text-align: center;
    padding: 3rem 1.5rem; /* Increased padding */
    color: var(--text-muted); /* Muted text color */
    border: 2px dashed var(--panel-border); /* Dashed border for empty state */
    border-radius: 8px;
    background-color: var(--header-darker); /* Slightly different background for emphasis */
    margin-top: 1rem;
    display: flex; /* Use flex for centering content */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state i, #empty-leagues i {
    font-size: 3rem; /* Larger icon */
    margin-bottom: 1rem; /* Space below icon */
    opacity: 0.5; /* Slightly more subtle icon */
    color: var(--text-muted);
}

.empty-state p, #empty-leagues p {
    font-size: 1rem; /* Slightly larger text */
    line-height: 1.6;
}

/* Styling for the "Add League" button if it's inside the panel header */
.leagues-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* panel-header already has padding from .panel in layout.css */
}

.leagues-panel .panel-header #add-league-btn {
    padding: 0.5rem 0.9rem; /* Slightly adjusted padding for a more compact button in header */
    font-size: 0.85rem; /* Slightly smaller font for header button */
    /* Other styles should come from .btn-primary */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 19, 24, 0.8);
    z-index: 1000;
    overflow: hidden; /* Prevent overlay from scrolling; let the modal content scroll */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Keep top in view when content is tall */
    opacity: 1;
}

.modal-content {
    background-color: var(--panel-bg);
    margin: 20px auto; /* Center horizontally; top/bottom margins provide breathing room */
    width: min(500px, calc(100vw - 40px)); /* Responsive width but never exceed 500px; accounts for margins */
    max-height: calc(100vh - 40px); /* Ensure content never exceeds viewport */
    border-radius: 8px;
    overflow-y: auto; /* Single internal scrollbar when needed */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--panel-border);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--header-dark);
    color: white;
    border-bottom: 1px solid var(--panel-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-header .close {
    font-size: 1.5rem;
    font-weight: lighter;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

/* Ensure plan-limit modal text is clearly readable */
#plan-limit-modal .modal-body,
#plan-limit-modal .modal-body p {
    color: #ffffff;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--panel-text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--header-darker);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--panel-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23697386' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.form-group select option {
    background-color: var(--panel-bg);
    color: var(--panel-text);
}

.help-text {
    display: flex;
    align-items: flex-start;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.help-text i {
    margin-right: 5px;
    margin-top: 3px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.help-text a {
    color: var(--accent-primary);
    text-decoration: none;
    margin-left: 5px;
}

.help-text a:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem 0 0.5rem 0;
    border-top: 1px solid var(--panel-border);
}

/* Center actions inside Add League modal */
#add-league-modal .form-actions,
#main-form-actions {
    justify-content: center;
}

/* Find League action row should not render a top border and aligns left */
#espn-find-league-actions {
    justify-content: center;
    border-top: none;
    margin-top: 0.75rem;
    padding-top: 0;
    width: 100%;
}

#espn-find-league-actions #find-espn-league-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    background: var(--accent-primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto; /* force center in any layout */
}

#espn-find-league-actions #find-espn-league-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#espn-find-league-actions #find-espn-league-btn:disabled {
    background: var(--panel-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Make the small bookmarklet trigger look like a text link, not a big button */
#add-league-modal .link-button {
    width: auto;
    display: inline;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--accent-primary);
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Use existing button classes if available, otherwise define styles */
/* Assuming .btn-secondary exists from buttons.css */
.modal .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    background-color: var(--panel-secondary);
    color: var(--panel-text-muted);
    border: 1px solid var(--panel-border);
    border-radius: 8px; /* Consistent modal button radius */
    transition: all 0.2s ease;
    min-width: 120px; /* Ensure consistent button width */
}

.modal .btn-secondary:hover {
    background-color: var(--panel-hover);
    color: var(--panel-text);
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal .btn-primary {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 6px; /* Consistent modal button radius */
    /* Styles should already be defined globally */
}

/* Style for the new delete confirmation modal's close button */
#delete-league-modal .close-delete-modal {
    font-size: 1.5rem;
    font-weight: lighter;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

#delete-league-modal .close-delete-modal:hover {
    color: var(--panel-text);
}

/* Delete League Modal Specific Styling */
#delete-league-modal .modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

#delete-league-modal .modal-body p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--panel-text);
    margin-bottom: 0;
    font-weight: 400;
}

#delete-league-modal .form-actions {
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding: 2rem 0 1rem 0;
    border-top: 1px solid var(--panel-border);
}

#delete-league-modal .modal-header {
    text-align: center;
    justify-content: center;
    position: relative;
}

#delete-league-modal .modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-red);
    margin: 0;
}

#delete-league-modal .close-delete-modal {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Ensure danger button in modal has consistent padding with other modal buttons */
.modal .btn-danger {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none; /* Remove unwanted borders */
    border-radius: 8px; /* Slightly larger radius for better appearance */
    color: white; /* Ensure text is white */
    transition: all 0.2s ease;
    min-width: 120px; /* Ensure consistent button width */
    /* Base .btn-danger in account.css already handles background/color */
}

.modal .btn-danger:hover {
    background-color: #df3e3e; /* Match global .btn-danger:hover */
    color: white; /* Ensure text remains white on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(223, 62, 62, 0.3);
}

/* Adjust ESPN Credentials section */
.espn-credentials {
    background-color: rgba(37, 99, 235, 0.05);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.espn-credentials label {
    margin-bottom: 0.5rem;
}

.espn-credentials input {
    margin-bottom: 0.75rem;
}

.espn-credentials .help-text {
    margin-top: 0.25rem;
}

/* Compact collapsible for ESPN creds */
.collapsible {
    margin-top: 0.5rem;
    border: none;
    background: transparent;
}

.collapsible .collapsible-content {
    padding: 0.75rem 0 0 0;
}

.link-button {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    padding: 0;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.instructions {
    margin-top: 0.5rem;
    padding: 0.25rem 0 0 0;
    background: transparent;
}

.instructions-title {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--panel-text);
    text-align: center;
}

.instructions ol {
    margin: 0.5rem 0 0.5rem 1.25rem;
    font-size: 0.95rem;
    color: var(--panel-text);
    line-height: 1.6;
}

.instructions .small-tip {
    color: var(--panel-text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Bookmarklet chip style to indicate draggable to bookmarks */
.bookmarklet-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--accent-primary);
    color: #fff !important;
    border-radius: 999px;
    text-decoration: none;
    cursor: grab;
    user-select: none;
    width: fit-content;
    position: relative;
    left: 50%;
    transform: translateX(-50%); /* force perfect centering regardless of parent */
}

.bookmarklet-chip:hover {
    background: var(--accent-hover);
}

.bookmarklet-chip i {
    font-size: 0.9rem;
}

.bookmarklet-hint {
    margin-top: 0.4rem;
    color: var(--panel-text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* League validation states */
.help-text.loading {
    color: var(--color-primary);
}

.help-text.success {
    color: #4caf50;
}

.help-text.error {
    color: var(--color-danger);
}

.help-text.loading i,
.help-text.success i,
.help-text.error i {
    font-size: 14px;
}

/* ESPN Validation Button Styling */
#espn-validation-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

#espn-validation-status {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

#validate-espn-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 6px;
    border: none;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin: 0 auto; /* force center */
}

#validate-espn-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

#validate-espn-btn:disabled {
    background: var(--panel-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

#validate-espn-btn i {
    font-size: 0.9rem;
}

/* Basic Information Section Styling */
.basic-information-section {
    background-color: var(--header-darker); /* Darker background like the image */
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem; /* Space before subscription info */
    border: 1px solid var(--panel-border);
    width: 100%; /* Make the information box span more of the panel */
    margin-left: auto; /* Center the block */
    margin-right: auto; /* Center the block */
}

.basic-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.basic-info-header h3 {
    color: var(--panel-text);
    font-size: 1.25rem; /* Prominent title */
    font-weight: 600;
    margin: 0;
}

.info-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0; /* Vertical spacing for each row */
    font-size: 1rem;
    border-bottom: none; /* Explicitly set to none */
}

.info-label {
    color: var(--panel-text-muted);
    font-weight: 500;
    white-space: nowrap;
    margin-right: 0;
}

.info-value {
    color: var(--panel-text);
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere; /* break long strings if needed */
    word-break: break-word;
}

/* Keep emails on one line with ellipsis; show full value on hover via title */
#user-display-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

/* Styles for Sleeper League Lookup in Add League Modal */
#sleeper-username-group .lookup-status {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#sleeper-username-group .lookup-status.loading {
    color: var(--panel-text-muted);
    background-color: rgba(37, 99, 235, 0.1); /* Subtle accent */
}

#sleeper-username-group .lookup-status.success {
    color: var(--accent-green);
    background-color: var(--accent-green-transparent);
}

#sleeper-username-group .lookup-status.info {
    color: var(--accent-yellow);
    background-color: var(--accent-yellow-transparent);
}

#sleeper-username-group .lookup-status.error {
    color: var(--accent-red);
    background-color: var(--accent-red-transparent);
}

#sleeper-league-results {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Space between league items */
    max-height: 250px; /* Limit height and allow scroll if many leagues */
    overflow-y: auto;
    /* Hide scrollbar for all browsers */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar for WebKit browsers */
#sleeper-league-results::-webkit-scrollbar {
    display: none;
}

.sleeper-league-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--header-darker);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.sleeper-league-item:hover {
    border-color: var(--accent-primary);
}

.sleeper-league-item .league-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
    overflow: hidden; /* To handle long league names */
}

.sleeper-league-item .league-avatar,
.sleeper-league-item .league-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sleeper-league-item .league-avatar-placeholder {
    background-color: var(--panel-secondary); /* Darker background for placeholder */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem; /* Adjust icon size if needed */
}

.sleeper-league-item .league-avatar-placeholder i {
    color: var(--accent-primary);
}

.sleeper-league-item .league-name {
    font-weight: 500;
    color: var(--panel-text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sleeper-league-item .league-season {
    font-size: 0.85rem;
    color: var(--panel-text-muted);
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.sleeper-league-item .btn-add-sleeper {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-left: 1rem; /* Space between info and button */
    flex-shrink: 0;
    min-width: 80px; /* Ensure button text is visible */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.sleeper-league-item .btn-add-sleeper i {
    font-size: 0.8rem;
}

/* Add error message styling for sleeper league item add */
.sleeper-league-item .add-error-message {
    display: block; /* Make it take its own line or style as needed */
    color: var(--accent-red);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    text-align: right; /* Or align with button */
}

/* Ensure green checkmark for added leagues within a disabled primary button */
.sleeper-league-item .btn-add-sleeper.btn-primary:disabled i.fa-check {
    color: var(--accent-green);
}
