/* Card Styles */

/* Card Collection Grids */
#card-collection, #deck-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

/* Base Card Styles */
.card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    width: 150px;
    height: 260px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #666;
    transform: translateY(-2px);
}

/* Card Type Colors */
.card.minion {
    border-color: #8B4513;
}

.card.spell {
    border-color: #4169E1;
}

/* Card Image Structure */
.card-image {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-info {
    background: rgba(0, 0, 0, 0.9);
    padding: 8px;
    margin-top: 120px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Card Elements */
.card-name {
    font-weight: bold;
    font-size: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #D3D0CB;
    text-shadow: 1px 1px 2px black;
    padding: 4px;
    margin-top: auto;
}

.card-cost {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #3096F3;
    color: #D3D0CB;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.card-health-modifier {
    position: absolute;
    top: 5px;
    left: 32px;
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.card-health-modifier.positive {
    background: #4CAF50;
}

.card-health-modifier.negative {
    background: #BF0603;
}

.card-stats {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: #D3D0CB;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.card-text {
    font-size: 10px;
    font-style: italic;
    color: #ccc;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 4px;
    margin: 2px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px black;
}

.card-keywords {
    font-size: 9px;
    color: #FFD700;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 4px;
    margin: 2px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px black;
}

/* Hand Card Styles */
.hand .card {
    position: relative;
    min-width: 120px;
}

.hand .card.playable {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Card Tooltips */
.card-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: #D3D0CB;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #444;
    font-size: 14px;
    z-index: 1002;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.card-tooltip.visible {
    opacity: 1;
}

.card-tooltip .tooltip-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    color: #FFD700;
}

.card-tooltip .tooltip-cost {
    color: #3096F3;
    font-weight: bold;
    margin-bottom: 4px;
}

.card-tooltip .tooltip-stats {
    color: #D3D0CB;
    font-weight: bold;
    margin-bottom: 4px;
}

.card-tooltip .tooltip-text {
    color: #CCC;
    font-style: italic;
    margin-bottom: 4px;
    line-height: 1.4;
}

.card-tooltip .tooltip-keywords {
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 4px;
}

.card-tooltip .tooltip-health-modifier {
    font-weight: bold;
    margin-bottom: 4px;
}

.card-tooltip .tooltip-health-modifier.positive {
    color: #4CAF50;
}

.card-tooltip .tooltip-health-modifier.negative {
    color: #BF0603;
}

.card-tooltip .tooltip-arrival {
    color: #90EE90;
    font-weight: bold;
    margin-bottom: 4px;
}

.card-tooltip .tooltip-effect {
    color: #87CEEB;
    font-style: italic;
}

/* Board Minion Styles */
.minion {
    position: relative;
    width: 80px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #8B4513;
}

.minion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.minion.can-attack {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.minion-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.minion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.minion-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 4px;
    pointer-events: none;
}

.minion-stats {
    color: #D3D0CB;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    text-shadow: 1px 1px 2px black;
}

.minion-keywords {
    font-size: 8px;
    color: #FFD700;
    text-align: center;
    font-weight: bold;
    text-shadow: 1px 1px 2px black; 
}

.damaged-health {
    color: #BF0603;
}

/* Responsive Card Styles */
@media (max-width: 768px) {
    .hand .card {
        min-width: 100px;
        font-size: 12px;
    }
    
    .minion {
        width: 60px;
        height: 80px;
    }
    
    .minion-stats {
        font-size: 12px;
    }
}