/**
 * D&D AI RPG - Bestiary System Styles
 * Creature encyclopedia and tracking
 */

/* Bestiary Panel */
.bestiary-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bestiary-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #27ae60;
    border-radius: 15px;
    max-width: 950px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(39, 174, 96, 0.2);
}

/* Header */
.bestiary-header {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    font-size: 32px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 10px;
}

.bestiary-header h2 {
    margin: 0;
    color: #fff;
    font-size: 22px;
}

.bestiary-header p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.bestiary-header .close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.bestiary-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

/* Tabs */
.bestiary-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px 0;
    gap: 5px;
    overflow-x: auto;
}

.bestiary-tab {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px 8px 0 0;
    color: #95a5a6;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    white-space: nowrap;
}

.bestiary-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.bestiary-tab.active {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border-bottom: 2px solid #27ae60;
}

/* Body */
.bestiary-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.bestiary-category {
    display: none;
}

.bestiary-category.active {
    display: block;
}

/* Creature Grid */
.creature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.creature-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.creature-card.discovered:hover {
    border-color: rgba(39, 174, 96, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.creature-card.undiscovered {
    opacity: 0.4;
    cursor: default;
}

.creature-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.creature-name {
    font-size: 13px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 5px;
}

.creature-card.discovered .creature-name {
    color: #27ae60;
}

.creature-cr {
    font-size: 11px;
    color: #f39c12;
    margin-bottom: 3px;
}

.creature-kills {
    font-size: 10px;
    color: #7f8c8d;
}

.no-creatures {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

/* Creature Detail Panel */
.creature-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creature-detail-panel .detail-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #27ae60;
    border-radius: 15px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.creature-detail-panel .detail-header {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-icon {
    font-size: 48px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 12px;
}

.detail-title h3 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.detail-title p {
    margin: 5px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.creature-detail-panel .close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s;
}

.creature-detail-panel .close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

.detail-body {
    padding: 20px;
}

/* Stat Row */
.stat-row {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.stat-block {
    text-align: center;
}

.stat-block .label {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-block .value {
    font-size: 20px;
    font-weight: bold;
    color: #27ae60;
}

/* Ability Scores */
.ability-scores {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.ability {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.ability-name {
    display: block;
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.ability-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #ecf0f1;
}

.ability-mod {
    display: block;
    font-size: 12px;
    color: #27ae60;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    color: #27ae60;
    font-size: 14px;
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(39, 174, 96, 0.3);
}

.detail-section p {
    font-size: 13px;
    color: #bdc3c7;
    line-height: 1.6;
    margin: 0;
}

.lore-text {
    font-style: italic;
    color: #95a5a6 !important;
}

/* Abilities List */
.abilities-list,
.drops-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ability-tag,
.drop-tag {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border-radius: 15px;
}

.drop-tag {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

/* Attacks List */
.attacks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attack-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
}

.attack-name {
    font-weight: bold;
    color: #ecf0f1;
    min-width: 80px;
}

.attack-bonus {
    color: #3498db;
    font-size: 13px;
}

.attack-damage {
    color: #e74c3c;
    font-size: 12px;
    flex: 1;
}

/* Notification */
.bestiary-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.95) 0%, rgba(30, 132, 73, 0.95) 100%);
    border: 3px solid #27ae60;
    border-radius: 12px;
    padding: 15px 25px;
    color: #fff;
    z-index: 5000;
    animation: bestiaryNotify 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(39, 174, 96, 0.4);
    font-weight: 500;
}

@keyframes bestiaryNotify {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

.bestiary-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
}

.bestiary-notification span {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .bestiary-content {
        max-width: 98%;
    }

    .creature-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .ability-scores {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-row {
        flex-wrap: wrap;
        gap: 15px;
    }
}
