/**
 * Playtest Modal Styles
 * Styling for deck testing/mulligan simulator
 */

/* Modal Container */
.playtest-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10200; /* Above deck details modal (10100) */
}

.playtest-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.playtest-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.playtest-modal-content {
    position: relative;
    background: var(--bg-body, #1e1e1e);
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Modal Header */
.playtest-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid var(--border-color, #333);
    background: linear-gradient(135deg, var(--bg-container, #2a2a2a) 0%, var(--bg-body, #1e1e1e) 100%);
}

.playtest-modal-header h2 {
    margin: 0;
    color: var(--color-white, #fff);
    font-size: 24px;
    font-weight: 600;
}

.playtest-modal .modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-muted, #999);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.playtest-modal .modal-close:hover {
    color: var(--color-white, #fff);
}

/* Modal Body */
.playtest-modal-body {
    padding: 30px;
}

/* Playtest Sections */
.playtest-section {
    margin-bottom: 40px;
}

.playtest-section:last-child {
    margin-bottom: 0;
}

.playtest-section h3 {
    color: var(--color-success, #4CAF50);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mulligan-section h3 {
    color: var(--color-warning, #FF9800);
}

.shields-section h3 {
    color: var(--color-primary, #2196F3);
}

/* Card Grid */
.playtest-cards {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.hand-cards {
    grid-template-columns: repeat(5, 1fr);
    max-width: 900px;
}

.shield-cards {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-width: 900px;
}

/* Individual Card */
.playtest-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.playtest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.playtest-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Shield Card Flip Animation */
.shield-card {
    cursor: pointer;
    perspective: 1000px;
}

.card-flip-container {
    position: relative;
    width: 100%;
    padding-bottom: 140%; /* 300x420 aspect ratio */
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.shield-card.flipped .card-flip-container {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
}

.card-back {
    background-image: url('https://zerosystem.cards/card-images/other/card-back-branded.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
}

.card-back-placeholder {
    /* Shield number overlay on card back - bottom aligned */
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    color: var(--color-white, #fff);
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-front {
    transform: rotateY(180deg);
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Action Buttons */
.playtest-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.playtest-actions .btn-primary,
.playtest-actions .btn-secondary {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playtest-actions .btn-primary {
    background: linear-gradient(135deg, var(--color-success, #4CAF50) 0%, #388E3C 100%);
    color: var(--color-white, white);
}

.playtest-actions .btn-primary:hover {
    background: linear-gradient(135deg, #66BB6A 0%, var(--color-success, #4CAF50) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.playtest-actions .btn-secondary {
    background: linear-gradient(135deg, var(--btn-secondary-bg, #757575) 0%, #616161 100%);
    color: var(--color-white, white);
}

.playtest-actions .btn-secondary:hover {
    background: linear-gradient(135deg, var(--btn-secondary-bg-hover, #9E9E9E) 0%, var(--btn-secondary-bg, #757575) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(117, 117, 117, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .playtest-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .playtest-modal-header {
        padding: 15px 20px;
    }

    .playtest-modal-header h2 {
        font-size: 20px;
    }

    .playtest-modal-body {
        padding: 20px;
    }

    .playtest-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .hand-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .shield-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .playtest-actions {
        flex-direction: column;
    }

    .playtest-actions .btn-primary,
    .playtest-actions .btn-secondary {
        width: 100%;
        padding: 14px;
    }

    .card-back-placeholder {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .hand-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .shield-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar Styling */
.playtest-modal-content::-webkit-scrollbar {
    width: 10px;
}

.playtest-modal-content::-webkit-scrollbar-track {
    background: var(--bg-container, #2a2a2a);
}

.playtest-modal-content::-webkit-scrollbar-thumb {
    background: var(--color-gray-500, #555);
    border-radius: 5px;
}

.playtest-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary, #777);
}
