/**
 * Tolarian Spellbook & MTG Engine — Callouts, Decklists & Spotlight Styles
 * 
 * Modulo CSS responsive e mobile-first per componenti editoriali e interattivi.
 * @package MTG_Engine
 * @version 6.3.0
 */

/* ==========================================================================
   1. UI Callouts (Pro Tips, Rules, Warnings, Lore, Market, Pros & Cons)
   ========================================================================== */

.tsb-callout {
    position: relative;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    font-size: 0.95rem;
    line-height: 1.6;
    transition: box-shadow 0.2s ease;
}

.tsb-callout:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.07);
}

.tsb-callout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.tsb-callout-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tsb-callout-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.tsb-callout-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.tsb-callout-body {
    color: #1e293b;
}

/* Tip & Stratagemma */
.tsb-callout.tsb-tip {
    background: #f0f7fb;
    border-left: 4px solid #3498db;
}
.tsb-callout.tsb-tip .tsb-callout-title {
    color: #1d4ed8;
}

/* Regola Ufficiale WotC */
.tsb-callout.tsb-rule {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
}
.tsb-callout.tsb-rule .tsb-callout-title {
    color: #1e40af;
}
.tsb-rule-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Warning & Errori Comuni */
.tsb-callout.tsb-warning {
    background: #fff8f0;
    border-left: 4px solid #e67e22;
}
.tsb-callout.tsb-warning .tsb-callout-title {
    color: #d35400;
}
.tsb-callout.tsb-warning .tsb-callout-body {
    color: #4a3828;
}

/* Lore & Narrazione */
.tsb-callout.tsb-lore {
    background: #fdfbf7;
    border-left: 4px solid #8e44ad;
    font-family: Georgia, Cambria, serif;
}
.tsb-callout.tsb-lore .tsb-callout-title {
    color: #7e22ce;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tsb-callout.tsb-lore .tsb-callout-body {
    color: #334155;
    font-style: italic;
    line-height: 1.65;
}
.tsb-lore-source {
    text-align: right;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 8px;
    font-style: normal;
}

/* Market Alert */
.tsb-callout.tsb-market {
    background: #f4faf6;
    border-left: 4px solid #10b981;
}
.tsb-callout.tsb-market.trend-down {
    background: #fef2f2;
    border-left-color: #ef4444;
}
.tsb-callout.tsb-market .tsb-callout-title {
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tsb-callout.tsb-market.trend-down .tsb-callout-title {
    color: #b91c1c;
}

/* Pros & Cons Box */
.tsb-callout.tsb-pros-cons {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    margin: 28px 0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04);
}
.tsb-pros-cons-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 20px;
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
}
.tsb-pros-cons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0;
}
.tsb-pros-column {
    padding: 18px 20px;
    background: #f0fdf4;
    border-right: 1px solid #e2e8f0;
}
.tsb-cons-column {
    padding: 18px 20px;
    background: #fef2f2;
}
.tsb-column-label {
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.tsb-pros-column .tsb-column-label { color: #166534; }
.tsb-cons-column .tsb-column-label { color: #991b1b; }
.tsb-pros-cons-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 0.93rem;
    color: #1e293b;
    line-height: 1.55;
}
.tsb-pros-cons-list li {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.tsb-pro-icon { color: #10b981; font-weight: 700; }
.tsb-con-icon { color: #ef4444; font-weight: 700; }

/* Quote Box */
.tsb-quote-box {
    background: #fafaf9;
    border-left: 4px solid #78716c;
    border-radius: 0 8px 8px 0;
    padding: 18px 24px;
    margin: 26px 0;
    font-family: Georgia, Cambria, serif;
    font-style: italic;
    color: #292524;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.tsb-quote-text {
    font-size: 1.05rem;
    line-height: 1.65;
}
.tsb-quote-author {
    text-align: right;
    margin-top: 10px;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
    font-style: normal;
}

/* Commander Bracket Badges */
.tsb-bracket-badge {
    border-radius: 8px;
    padding: 12px 18px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left-width: 4px;
    border-left-style: solid;
}
.tsb-bracket-badge-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tsb-bracket-badge-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.tsb-bracket-badge-desc {
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Bracket 1-5 & Special Types */
.tsb-bracket-1 { background: #ecfdf5; border-left-color: #10b981; color: #065f46; }
.tsb-bracket-1 .tsb-bracket-badge-dot { background: #10b981; }
.tsb-bracket-2 { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }
.tsb-bracket-2 .tsb-bracket-badge-dot { background: #3b82f6; }
.tsb-bracket-3 { background: #f5f3ff; border-left-color: #8b5cf6; color: #5b21b6; }
.tsb-bracket-3 .tsb-bracket-badge-dot { background: #8b5cf6; }
.tsb-bracket-4 { background: #fff7ed; border-left-color: #f97316; color: #c2410c; }
.tsb-bracket-4 .tsb-bracket-badge-dot { background: #f97316; }
.tsb-bracket-5 { background: #fef2f2; border-left-color: #dc2626; color: #991b1b; }
.tsb-bracket-5 .tsb-bracket-badge-dot { background: #dc2626; }
.tsb-bracket-tournament {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left-color: #d97706;
    color: #78350f;
}
.tsb-bracket-tournament .tsb-bracket-badge-title { color: #92400e; }
.tsb-bracket-tournament .tsb-bracket-badge-dot { background: #d97706; }
.tsb-bracket-average {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border-left-color: #0284c7;
    color: #334155;
}
.tsb-bracket-average .tsb-bracket-badge-title { color: #0369a1; }
.tsb-bracket-average .tsb-bracket-badge-dot { background: #0284c7; }


/* ==========================================================================
   2. Decklist Shortcode Container ([mtg_deck])
   ========================================================================== */

.tsb-decklist-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 28px 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden;
}

.tsb-decklist-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tsb-decklist-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tsb-decklist-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tsb-decklist-tier-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: #0284c7;
}

.tsb-decklist-title {
    margin: 0;
    font-size: 1.35rem;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.tsb-decklist-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: #64748b;
    flex-wrap: wrap;
}

.tsb-decklist-body {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.tsb-deck-section-title {
    margin: 0 0 10px 0;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.tsb-deck-card-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tsb-deck-card-item {
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tsb-deck-card-qty {
    display: inline-block;
    min-width: 24px;
    color: #64748b;
    font-weight: 600;
}

.tsb-decklist-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.tsb-deck-export-details summary {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0284c7;
    cursor: pointer;
    user-select: none;
}

.tsb-deck-export-textarea {
    width: 100%;
    height: 150px;
    margin-top: 10px;
    font-family: monospace;
    font-size: 0.82rem;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    resize: vertical;
}

.tsb-copy-btn {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tsb-copy-btn:hover {
    background: #0369a1;
}

.tsb-copy-btn.copied {
    background: #10b981;
}


/* ==========================================================================
   3. Single Card Image Alignment & Spotlight ([mtg_cardimage], [mtg_card_spotlight])
   ========================================================================== */

.mtg-card-single {
    display: inline-block;
    margin: 16px 0;
    vertical-align: middle;
    text-align: center;
}

.mtg-card-single.align-left {
    float: left;
    margin: 8px 24px 16px 0;
    clear: left;
}

.mtg-card-single.align-right {
    float: right;
    margin: 8px 0 16px 24px;
    clear: right;
}

.mtg-card-single.align-center {
    display: block;
    margin: 24px auto;
    text-align: center;
    clear: both;
}

.mtg-card-single.size-small img,
.mtg-card-single.size-small .mtg-card-image-container {
    max-width: 180px;
}

.mtg-card-single.size-medium img,
.mtg-card-single.size-medium .mtg-card-image-container {
    max-width: 240px;
}

.mtg-card-single.size-normal img,
.mtg-card-single.size-normal .mtg-card-image-container {
    max-width: 280px;
}

.mtg-card-single.size-large img,
.mtg-card-single.size-large .mtg-card-image-container {
    max-width: 360px;
}

.mtg-card-single img {
    border-radius: 4.75% / 3.5%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    height: auto;
    margin: 0 auto;
}

.mtg-card-single:hover img {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.mtg-card-caption {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 8px;
    font-style: italic;
    line-height: 1.4;
    text-align: center;
}

/* Card Spotlight (Vetrina Orizzontale a 2 Colonne) */
.mtg-card-spotlight {
    display: flex;
    gap: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin: 28px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    align-items: flex-start;
}

.mtg-spotlight-image-col {
    flex: 0 0 260px;
    max-width: 260px;
}

.mtg-spotlight-image-col img {
    width: 100%;
    border-radius: 4.75% / 3.5%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.mtg-spotlight-details-col {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mtg-spotlight-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mtg-spotlight-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.mtg-spotlight-type {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
}

.mtg-spotlight-oracle {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    padding: 12px 14px;
    border-radius: 0 6px 6px 0;
}

.mtg-spotlight-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: #64748b;
}

.mtg-spotlight-legalities {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.mtg-legality-chip {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}

.mtg-legality-chip.is-legal { background: #dcfce7; color: #15803d; }
.mtg-legality-chip.is-banned { background: #fee2e2; color: #b91c1c; }
.mtg-legality-chip.is-restricted { background: #fef3c7; color: #b45309; }

@media (max-width: 768px) {
    .mtg-card-spotlight {
        flex-direction: column;
        align-items: center;
    }
    .mtg-spotlight-image-col {
        flex: 0 0 auto;
        max-width: 240px;
    }
    .mtg-card-single.align-left,
    .mtg-card-single.align-right {
        float: none;
        display: block;
        margin: 20px auto;
    }
}


/* ==========================================================================
   4. Tooltip Inline Enhancements
   ========================================================================== */

.mtg-card-tooltip.is-foil {
    background: linear-gradient(90deg, #b8860b, #ffd700, #ff8c00, #b8860b);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    animation: mtg-foil-shimmer 4s ease infinite;
}

@keyframes mtg-foil-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.mtg-tooltip-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
    display: inline-block;
}
