/* ABOUTME: Modern, responsive CSS for dynasty league toolkit features
 * ABOUTME: Includes masonry grid layouts, card designs, and visual polish */

/* Dynasty Grid Layout - Modern & Space Efficient */
.league-grid-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 2.5vw, 32px);
    width: 100%;
    align-items: start;
    grid-auto-rows: minmax(0, auto);
}
.league-grid-container.single-column {
    grid-template-columns: minmax(0, 1fr);
}

/* On larger screens, use full width and let toolkit use masonry grid */
@media (min-width: 1100px) {
    .league-grid-container {
        grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
        gap: 32px;
    }
    .league-grid-container.single-column {
        grid-template-columns: minmax(0, 1fr);
    }
}

.roster-card {
    min-width: 0;
    background: linear-gradient(160deg, rgba(30, 38, 54, 0.6), rgba(15, 23, 42, 0.4));
    border-radius: 16px;
    border: 1px solid rgba(125, 211, 252, 0.15);
    border-left: 4px solid rgba(123, 176, 255, 0.35);
    padding: 20px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
}

/* Modern Masonry Grid for Dynasty Toolkit */
.dynasty-toolkit {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    align-self: start;
}
.dynasty-source-info {
    grid-column: 1 / -1;
    font-size: 0.85em;
    color: #9fb3d4;
    text-align: center;
    padding: 4px 0;
}
.dynasty-source-info a {
    color: #7bb0ff;
    text-decoration: none;
    font-weight: 600;
}
.dynasty-source-info a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .dynasty-toolkit {
        gap: 24px;
    }
}

/* Modern Card Design */
.toolkit-card {
    background: linear-gradient(160deg, rgba(30, 38, 54, 0.62), rgba(15, 23, 42, 0.4));
    border-radius: 16px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-left: 4px solid rgba(123, 176, 255, 0.25);
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
    height: auto;
    width: 100%;
}

.toolkit-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-accent);
}

.premium-card .card-header {
	cursor: default;
}

.premium-text {
	white-space: pre-wrap;
	line-height: 1.6;
	color: #e8eef7;
	font-size: 0.95em;
}

.card-header {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    transition: all 0.2s ease;
    user-select: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.card-header:hover {
    background: linear-gradient(135deg, rgba(58, 110, 232, 0.15) 0%, rgba(88, 86, 214, 0.15) 100%);
}

.card-title {
    font-size: 1em;
    font-weight: 700;
    color: #e8eef7;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #7bb0ff, #5856d6);
    border-radius: 2px;
}

.collapse-icon {
    color: #7bb0ff;
    font-size: 1.2em;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
}

.card-header:hover .collapse-icon {
    opacity: 1;
}

.card-content {
    padding: 24px;
    animation: fadeIn 0.3s ease;
    overflow: visible;
    max-width: 100%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.card-content > * {
    min-width: 0;
}

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

/* Badge Styles */
.news-count, .breakout-count, .aging-count, .transactions-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    background: linear-gradient(135deg, rgba(123, 176, 255, 0.25), rgba(88, 86, 214, 0.25));
    border-radius: 14px;
    font-size: 0.85em;
    font-weight: 700;
    color: #e8eef7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breakout-count {
    background: linear-gradient(135deg, rgba(58, 232, 122, 0.25), rgba(30, 180, 90, 0.25));
}

.aging-count {
    background: linear-gradient(135deg, rgba(255, 157, 92, 0.25), rgba(255, 120, 50, 0.25));
}

/* News Feed - Compact & Modern */
.news-feed, .transactions-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item, .transaction-item {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border-left: 4px solid rgba(123, 176, 255, 0.35);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.news-item:hover, .transaction-item:hover {
    background: var(--bg-card);
    border-left-color: rgba(123, 176, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.news-item.news-injury {
    border-left-color: rgba(255, 123, 123, 0.6);
    background: rgba(255, 123, 123, 0.05);
}

.news-item.news-injury:hover {
    background: rgba(255, 123, 123, 0.12);
    border-left-color: rgba(255, 123, 123, 0.9);
}

.news-header, .transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.news-player, .transaction-type {
    font-weight: 600;
    color: #e8eef7;
    font-size: 0.95em;
    min-width: 0;
    overflow-wrap: anywhere;
}

.starter-badge {
    font-size: 0.85em;
    margin-left: 6px;
    color: #ffc83a;
    filter: drop-shadow(0 0 4px rgba(255, 200, 58, 0.4));
}

.news-time, .transaction-time {
    font-size: 0.8em;
    color: #9fb3d4;
    white-space: nowrap;
    opacity: 0.8;
}

.news-injury-status {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 8px;
    font-size: 0.8em;
    font-weight: 600;
    background: rgba(255, 123, 123, 0.2);
    color: #ff7b7b;
    border-radius: 6px;
    border: 1px solid rgba(255, 123, 123, 0.3);
}

.news-text, .transaction-desc {
    color: #d4dde8;
    line-height: 1.6;
    margin-bottom: 6px;
    font-size: 0.92em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.news-source, .transaction-players {
    font-size: 0.8em;
    color: #7bb0ff;
    font-style: italic;
    opacity: 0.8;
}

/* Player Cards - Modern Design */
.player-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.player-card {
    background: rgba(30, 38, 54, 0.5);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.player-card:hover {
    background: rgba(30, 38, 54, 0.7);
    transform: translateX(6px);
    border-color: rgba(123, 176, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.breakout-card {
    border-left: 4px solid rgba(58, 232, 122, 0.6);
}

.breakout-card:hover {
    border-left-color: rgba(58, 232, 122, 1);
    box-shadow: 0 4px 16px rgba(58, 232, 122, 0.15);
}

.aging-card {
    border-left: 4px solid rgba(255, 157, 92, 0.6);
}

.aging-card:hover {
    border-left-color: rgba(255, 157, 92, 1);
    box-shadow: 0 4px 16px rgba(255, 157, 92, 0.15);
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.player-card-name {
    font-weight: 600;
    color: #e8eef7;
    font-size: 1em;
    min-width: 0;
    overflow-wrap: anywhere;
}

.player-card-age {
    font-size: 0.85em;
    color: #3ae87a;
    font-weight: 700;
    background: rgba(58, 232, 122, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(58, 232, 122, 0.3);
}

.aging-age {
    color: #ff9d5c;
    background: rgba(255, 157, 92, 0.15);
    border-color: rgba(255, 157, 92, 0.3);
}

.player-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.player-card-pos {
    color: #7bb0ff;
    font-weight: 600;
}

.player-card-value {
    color: #9fb3d4;
    font-weight: 500;
}

.aging-warning {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 0.85em;
    color: #ff9d5c;
    background: rgba(255, 157, 92, 0.1);
    border-radius: 6px;
    border-left: 3px solid rgba(255, 157, 92, 0.5);
}

/* Draft Picks - Modern Grid */
.draft-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.draft-pick-card {
    background: linear-gradient(135deg, rgba(123, 176, 255, 0.1), rgba(88, 86, 214, 0.08));
    border: 2px solid rgba(123, 176, 255, 0.25);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.draft-pick-card:hover {
    background: linear-gradient(135deg, rgba(123, 176, 255, 0.15), rgba(88, 86, 214, 0.12));
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(123, 176, 255, 0.2);
    border-color: rgba(123, 176, 255, 0.5);
}

.draft-pick-card.traded-pick {
    border-color: #3ae87a;
    background: linear-gradient(135deg, rgba(58, 232, 122, 0.1), rgba(30, 180, 90, 0.08));
}

.draft-pick-card.traded-pick:hover {
    background: linear-gradient(135deg, rgba(58, 232, 122, 0.15), rgba(30, 180, 90, 0.12));
    box-shadow: 0 8px 20px rgba(58, 232, 122, 0.2);
}

.pick-year {
    font-size: 1.5em;
    font-weight: 800;
    color: #7bb0ff;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.draft-pick-card.traded-pick .pick-year {
    color: #3ae87a;
}

.pick-round {
    font-size: 1em;
    color: #c5d5f0;
    font-weight: 600;
    margin-bottom: 4px;
}

.pick-origin {
    font-size: 0.85em;
    color: #3ae87a;
    margin-top: 8px;
    font-weight: 500;
}

/* Trade Targets - Modern Cards */
.trade-target-item {
    background: rgba(30, 38, 54, 0.5);
    border: 1px solid rgba(123, 176, 255, 0.2);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.trade-target-item:last-child {
    margin-bottom: 0;
}

.trade-target-item:hover {
    background: rgba(30, 38, 54, 0.7);
    border-color: rgba(123, 176, 255, 0.4);
    transform: translateX(6px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.target-team {
    font-size: 1.15em;
    font-weight: 700;
    color: #e8eef7;
    margin-bottom: 10px;
}

.target-reason {
    font-size: 0.95em;
    color: #3ae87a;
    margin-bottom: 14px;
    font-weight: 500;
}

.target-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.surplus-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    padding: 10px 12px;
    background: rgba(123, 176, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(123, 176, 255, 0.3);
}

.surplus-label {
    color: #9fb3d4;
    font-weight: 600;
}

.surplus-value {
    color: #e8eef7;
    font-weight: 600;
}

/* Empty States - More Engaging */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
    filter: grayscale(20%);
}

.empty-state-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #e8eef7;
    margin-bottom: 14px;
}

.empty-state-text {
    font-size: 0.95em;
    color: #9fb3d4;
    line-height: 1.7;
    max-width: 450px;
    margin: 0 auto;
}

/* Tables - Modern Styling */
.age-chart-table, .rookies-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
    max-width: 100%;
}

/* Ensure tables don't cause horizontal overflow */
.card-content table {
    table-layout: auto;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Wrapper for tables to handle overflow */
.table-wrapper,
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.age-chart-table thead th, .rookies-table thead th {
    background: linear-gradient(135deg, rgba(123, 176, 255, 0.15), rgba(88, 86, 214, 0.15));
    padding: 14px 12px;
    font-size: 0.85em;
    font-weight: 700;
    color: #e8eef7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.age-chart-table thead th:first-child {
    border-radius: 8px 0 0 8px;
}

.age-chart-table thead th:last-child {
    border-radius: 0 8px 8px 0;
}

.age-chart-table tbody tr, .rookies-table tbody tr {
    background: rgba(30, 38, 54, 0.3);
    transition: all 0.2s ease;
}

.age-chart-table tbody tr:hover, .rookies-table tbody tr:hover {
    background: rgba(58, 110, 232, 0.15);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.age-chart-table tbody td, .rookies-table tbody td {
    padding: 14px 12px;
    font-size: 0.95em;
    color: #e8eef7;
    text-align: center;
    border: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.age-chart-table tbody tr td:first-child {
    border-radius: 8px 0 0 8px;
}

.age-chart-table tbody tr td:last-child {
    border-radius: 0 8px 8px 0;
}

/* Positional Breakdown - Modern Bars */
.positional-breakdown {
    background: rgba(30, 38, 54, 0.4);
    border: 1px solid rgba(123, 176, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.breakdown-title {
    font-size: 0.9em;
    font-weight: 700;
    color: #7bb0ff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 45px 1fr 65px;
    align-items: center;
    gap: 14px;
}

.breakdown-pos {
    font-weight: 700;
    color: #e8eef7;
    font-size: 0.95em;
}

.breakdown-bar-wrap {
    background: rgba(30, 38, 54, 0.8);
    border-radius: 10px;
    height: 24px;
    overflow: hidden;
    border: 1px solid rgba(123, 176, 255, 0.2);
}

.breakdown-bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, rgba(123, 176, 255, 0.7) 0%, rgba(88, 86, 214, 0.9) 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(123, 176, 255, 0.3);
}

.breakdown-pct {
    font-size: 0.95em;
    color: #e8eef7;
    font-weight: 700;
    text-align: right;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .dynasty-toolkit {
        gap: 16px;
    }

    .toolkit-card {
        border-radius: 12px;
    }

    .card-header {
        padding: 16px 20px;
    }

    .card-title {
        font-size: 0.95em;
    }

    .card-content {
        padding: 20px;
    }

    .news-item, .transaction-item {
        padding: 14px;
    }

    .news-header, .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .draft-picks-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .player-card {
        padding: 14px;
    }

    .breakdown-item {
        grid-template-columns: 40px 1fr 55px;
        gap: 12px;
    }
}

/* Transaction Trade Styles - Detailed gave/got display */
.trade-details {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.trade-side {
    flex: 1;
    min-width: 0;
    background: rgba(21, 27, 46, 0.4);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid rgba(123, 176, 255, 0.15);
}

.trade-team {
    font-weight: 700;
    color: #7bb0ff;
    font-size: 0.95em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(123, 176, 255, 0.2);
    overflow-wrap: anywhere;
}

.trade-action {
    margin-top: 10px;
}

.trade-label {
    display: inline-block;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.trade-label.gave {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.trade-label.got {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.trade-player {
    padding: 6px 12px;
    margin: 4px 0;
    background: rgba(30, 38, 54, 0.5);
    border-radius: 6px;
    font-size: 0.9em;
    color: #d4dde8;
    border-left: 2px solid rgba(123, 176, 255, 0.3);
    overflow-wrap: anywhere;
}

.trade-divider {
    font-size: 1.5em;
    color: #7bb0ff;
    font-weight: 700;
    filter: drop-shadow(0 0 8px rgba(123, 176, 255, 0.6));
    animation: pulse-divider 2s ease-in-out infinite;
}

@keyframes pulse-divider {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@media (max-width: 768px) {
    .trade-details {
        flex-direction: column;
        align-items: stretch;
    }

    .trade-divider {
        display: none;
    }
}

/* Waiver Details */
.waiver-details {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.95em;
}

.waiver-team {
    font-weight: 600;
    color: #7bb0ff;
    margin-bottom: 8px;
}

.waiver-action {
    flex: 1;
}

.waiver-added {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.waiver-dropped {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.waiver-label {
    display: block;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.waiver-added .waiver-label {
    color: #86efac;
}

.waiver-dropped .waiver-label {
    color: #fca5a5;
}

.waiver-player {
    color: #e8eef7;
    font-weight: 600;
}

/* Transaction Filters */
.transaction-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(30, 38, 54, 0.5);
    border: 1px solid rgba(123, 176, 255, 0.2);
    border-radius: 8px;
    color: #9fb3d4;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(58, 110, 232, 0.2);
    border-color: rgba(123, 176, 255, 0.4);
    color: #e8eef7;
}

.filter-btn.active {
    background: linear-gradient(135deg, #3a6ee8 0%, #5856d6 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(58, 110, 232, 0.3);
}

.transactions-count, .breakout-count, .aging-count, .news-count {
    display: inline-block;
    padding: 3px 10px;
    margin-left: 8px;
    background: rgba(123, 176, 255, 0.2);
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: #7bb0ff;
}
