/* ========================================
   SPELLBOOK COMPONENTS - TEAL GREEN #7bc9a6
   Holographic buttons, teal accents throughout
   ======================================== */

/* Collapsible Sections */
.collapsible-section {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.collapsible-section:hover {
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.7);
    transform: translateY(-1px);
}

.section-header {
    padding: 20px 28px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    background: rgba(167, 139, 250, 0.05);
}

.section-header:hover {
    background: rgba(167, 139, 250, 0.1);
}

.section-header h2 {
    color: #c4b5fd;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: 'Lora', serif;
    text-align: center;
    text-shadow: 0 1px 8px rgba(167, 139, 250, 0.4);
}

.section-toggle {
    font-size: 1em;
    color: #c4b5fd;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: bold;
    position: absolute;
    right: 28px;
    opacity: 0.8;
}

.section-toggle.active {
    transform: rotate(180deg);
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content.active {
    max-height: 3000px;
}

.section-content-inner {
    padding: 0 28px 24px 28px;
    background: rgba(10, 10, 15, 0.5);
}

.section-content p {
    line-height: 1.7;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 14px;
}

/* CYAN for "casting speed" - matching Action/Bonus Speed */
.section-content strong {
    color: #00ffcc;
    font-weight: 600;
    font-size: 1.05rem;
    text-shadow: 0 1px 6px rgba(0, 255, 204, 0.5);
}

/* Methodology Items */
.methodology-item {
    margin-bottom: 18px;
    padding: 14px 18px;
    background: rgba(167, 139, 250, 0.08);
    border-left: 3px solid rgba(167, 139, 250, 0.5);
    border-radius: 0 10px 10px 0;
}

/* PURPLE for methodology titles "Rune Writing" and "Charge Casting" */
.methodology-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #c4b5fd;
    text-shadow: 0 1px 8px rgba(167, 139, 250, 0.5);
}

/* CYAN BULLET POINTS - matching Action/Bonus Speed */
.charge-rules {
    color: #00ffcc !important;
    font-size: 0.9rem !important;
    margin-top: 12px;
    padding-left: 0;
    border-left: none;
    line-height: 1.8;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 255, 204, 0.4);
}

/* Spellbook Section */
.spellbook-section {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 16px;
    padding: 32px 28px;
    margin-top: 30px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.spellbook-section:hover {
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.7);
}

/* PURPLE for section titles "Prepared Spells" and "Casting History" */
.spellbook-section h2 {
    color: #c4b5fd;
    font-size: 1.75rem;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: 'Lora', serif;
    text-shadow: 0 2px 12px rgba(167, 139, 250, 0.5);
}

.spell-list {
    display: grid;
    gap: 16px;
}

/* ========================================
   CASTING HISTORY - TEAL GREEN #7bc9a6
   ======================================== */
.casting-history-list {
    display: grid;
    gap: 14px;
}

.history-entry-compact {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 14px;
    padding: 20px 24px;
    transition: all 0.3s ease;
}

.history-entry-compact:hover {
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.2);
    transform: translateY(-1px);
}

.history-compact-main {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 28px;
    align-items: center;
}

.history-compact-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* TEAL GREEN - Vivid but comfortable */
.history-runes-display {
    color: #7bc9a6;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Lora', serif;
    font-style: italic;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(123, 201, 166, 0.5);
}

.history-timestamp {
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Stats Pills */
.history-compact-stats {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

.history-stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 16px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 12px;
    min-width: 100px;
    transition: all 0.3s ease;
}

.history-stat-pill:hover {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.25);
}

.history-stat-pill .pill-label {
    color: #c4b5fd;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.history-stat-pill .pill-value {
    color: #e9d5ff;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 8px rgba(167, 139, 250, 0.5);
}

/* ========================================
   TRANSLUCENT HOLOGRAPHIC BUTTONS
   Matching the style from the reference image
   ======================================== */
.history-compact-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.history-action-btn {
    width: 90px;
    height: 40px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Lora', serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Enhanced holographic shimmer effect - animated constantly */
.history-action-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -200%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 25%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 100%
    );
    transform: skewX(-25deg);
    animation: holographic-sweep 3s infinite;
    pointer-events: none;
}

@keyframes holographic-sweep {
    0% {
        left: -200%;
    }
    50%, 100% {
        left: 200%;
    }
}

/* Additional rainbow shimmer layer on hover */
.history-action-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.history-action-btn:hover::after {
    opacity: 1;
}

.history-action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.history-action-btn:active {
    transform: translateY(0px);
    filter: brightness(0.95);
}

/* Cast Button - PURPLE translucent with matching border */
.history-cast-btn {
    background: rgba(139, 92, 246, 0.25);
    color: rgba(196, 181, 253, 0.95);
    border: 1px solid rgba(167, 139, 250, 0.5);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.history-cast-btn:hover {
    background: rgba(139, 92, 246, 0.35);
    border-color: rgba(167, 139, 250, 0.7);
    color: rgba(233, 213, 255, 1);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5),
                0 0 24px rgba(167, 139, 250, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Prepare Button - TEAL BLUE translucent with matching border */
.history-prepare-btn {
    background: rgba(123, 201, 166, 0.25);
    color: rgba(123, 201, 166, 0.95);
    border: 1px solid rgba(123, 201, 166, 0.5);
    box-shadow: 0 2px 8px rgba(123, 201, 166, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.history-prepare-btn:hover {
    background: rgba(123, 201, 166, 0.35);
    border-color: rgba(123, 201, 166, 0.7);
    color: rgba(157, 217, 191, 1);
    box-shadow: 0 4px 16px rgba(123, 201, 166, 0.5),
                0 0 24px rgba(123, 201, 166, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Remove Button - RED translucent with matching border */
.history-remove-btn {
    background: rgba(239, 68, 68, 0.25);
    color: rgba(252, 165, 165, 0.95);
    border: 1px solid rgba(248, 113, 113, 0.5);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.history-remove-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(248, 113, 113, 0.7);
    color: rgba(254, 202, 202, 1);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5),
                0 0 24px rgba(248, 113, 113, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .history-compact-main {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .history-compact-stats {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .history-stat-pill {
        min-width: 95px;
    }
    
    .history-compact-actions {
        justify-content: center;
    }
    
    .history-action-btn {
        width: 85px;
        height: 38px;
    }
}

@media (max-width: 768px) {
    .section-header {
        padding: 18px 24px;
    }

    .section-header h2 {
        font-size: 1.05rem;
    }

    .section-toggle {
        right: 24px;
    }

    .section-content-inner {
        padding: 0 24px 20px 24px;
    }

    .methodology-item {
        padding: 12px 16px;
    }

    .spellbook-section {
        padding: 28px 24px;
        margin-top: 24px;
    }

    .spellbook-section h2 {
        font-size: 1.5rem;
        margin-bottom: 22px;
    }

    .history-entry-compact {
        padding: 18px 20px;
    }

    .history-runes-display {
        font-size: 1.1rem;
    }

    .history-stat-pill {
        padding: 8px 14px;
        min-width: 90px;
    }

    .history-stat-pill .pill-label {
        font-size: 0.65rem;
    }

    .history-stat-pill .pill-value {
        font-size: 1.15rem;
    }

    .history-action-btn {
        width: 80px;
        height: 36px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .section-header {
        padding: 16px 20px;
    }

    .section-header h2 {
        font-size: 0.95rem;
    }

    .section-toggle {
        right: 20px;
        font-size: 0.9em;
    }

    .section-content-inner {
        padding: 0 20px 18px 20px;
    }

    .section-content p {
        font-size: 0.9rem;
    }

    .methodology-item {
        padding: 12px 14px;
        margin-bottom: 16px;
    }

    .methodology-item strong {
        font-size: 1rem;
    }

    .charge-rules {
        font-size: 0.85rem !important;
        padding-left: 16px;
    }

    .spellbook-section {
        padding: 24px 20px;
        margin-top: 20px;
    }

    .spellbook-section h2 {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    .history-entry-compact {
        padding: 16px 18px;
    }

    .history-compact-main {
        gap: 12px;
    }

    .history-runes-display {
        font-size: 1rem;
    }

    .history-compact-stats {
        gap: 8px;
        flex-direction: column;
        width: 100%;
    }

    .history-stat-pill {
        padding: 8px 14px;
        min-width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }

    .history-stat-pill .pill-label {
        font-size: 0.65rem;
    }

    .history-stat-pill .pill-value {
        font-size: 1.05rem;
    }

    .history-action-btn {
        width: 75px;
        height: 34px;
        font-size: 0.7rem;
    }
}

/* VIVID CYAN - Spell names in casting history */
.history-runes-display.history-spell-name {
    color: #00ffcc;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Lora', serif;
    font-style: italic;
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(0, 255, 204, 0.6);
}

/* Original runes display (if still used elsewhere) */
.history-runes-display {
    color: #7bc9a6;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Lora', serif;
    font-style: italic;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(123, 201, 166, 0.5);
}