/* Shared Card Modal Styles - Used by both viewer.html and index.html */

/* DCard Modal Base */
.dcard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.dcard-modal.active {
    display: flex;
}

.dcard-modal.active .dcard-modal-overlay {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.dcard-modal.active .dcard-modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dcard-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
}

.dcard-modal-content {
    position: relative;
    background: transparent;
    border-radius: 16px;
    max-width: clamp(320px, 90vw, 900px);
    width: 90%;
    min-height: 400px;
    max-height: 90vh;
    overflow: visible;
    border: none;
    box-shadow: none;
    z-index: 10000;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
}

.dcard-modal-close {
    position: absolute;
    top: clamp(12px, 2vw, 16px);
    right: clamp(12px, 2vw, 16px);
    width: clamp(32px, 5vw, 40px);
    height: clamp(32px, 5vw, 40px);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: clamp(20px, 3.5vw, 28px);
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dcard-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.dcard-modal-body {
    padding: clamp(1rem, 3vw, 2rem);
    overflow: visible;
}

@media (min-width: 768px) {
    .dcard-modal-body {
        padding: clamp(2rem, 4vw, 3rem);
    }
}

.dcard-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    overflow: visible;
}

@media (min-width: 768px) {
    .dcard-modal-grid {
        grid-template-columns: clamp(280px, 35vw, 400px) 1fr;
        gap: clamp(1.5rem, 3vw, 3rem);
    }
}

@media (min-width: 1024px) {
    .dcard-modal-grid {
        grid-template-columns: clamp(320px, 40vw, 400px) 1fr;
        gap: 3rem;
    }
}

.dcard-modal-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mobile: show only the card, hide info panel */
@media (max-width: 767px) {

    .dcard-modal-info,
    .dcard-modal-title,
    .dcard-modal-details,
    .dcard-modal-description {
        display: none !important;
    }

    .dcard-modal-body {
        padding: 0 !important;
        background: transparent !important;
    }

    .dcard-modal-content {
        width: 90%;
        max-width: 380px;
        max-height: 90vh;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 auto;
    }

    .dcard-modal-grid {
        grid-template-columns: 1fr;
        gap: 0;
        background: transparent !important;
        padding: 0 !important;
    }

    .dcard-modal {
        align-items: center;
        justify-content: center;
        padding: 12px;
    }

    .dcard-modal-image-container {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        background: transparent !important;
    }

    .dcard-modal-image-wrapper {
        background: transparent !important;
    }

    .dcard-modal-image {
        box-shadow: none !important;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 80px);
        object-fit: contain;
        background: transparent !important;
    }
}

.dcard-modal-image-container {
    width: 100%;
    max-width: clamp(280px, 35vw, 400px);
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

@media (min-width: 1024px) {
    .dcard-modal-image-container {
        max-width: clamp(320px, 40vw, 400px);
    }
}

.dcard-modal-image-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: visible;
}

.dcard-modal-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(156, 39, 176, 0.4);
    transition: transform 0.1s ease-out;
    cursor: pointer;
    transform-style: preserve-3d;
    position: relative;
    z-index: 1;
    display: block;
}

.dcard-modal-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.dcard-modal-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dcard-modal-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dcard-modal-label {
    font-weight: 700;
    color: #ce93d8;
    text-transform: uppercase;
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    letter-spacing: 0.05em;
}

.dcard-modal-value {
    color: #f3e5f5;
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 600;
}

.dcard-modal-description {
    background: rgba(156, 39, 176, 0.15);
    padding: clamp(1rem, 2.5vw, 1.25rem);
    border-radius: 12px;
    border: 1px solid rgba(156, 39, 176, 0.4);
}

.dcard-modal-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 700;
    color: #ce93d8;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dcard-modal-description p {
    color: #f3e5f5;
    line-height: 1.6;
    margin: 0;
    font-size: clamp(0.875rem, 1.8vw, 1rem);
}

/* Landing Page Modal Navigation Arrows */
.dcard-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(156, 39, 176, 0.6);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.2s ease;
    z-index: 10002;
    font-size: 1.25rem;
}

.dcard-modal-nav:hover,
.dcard-modal-nav:focus,
.dcard-modal-nav:active {
    background: rgba(156, 39, 176, 0.9);
    outline: none;
}

.dcard-modal-nav.prev {
    left: -60px;
}

.dcard-modal-nav.next {
    right: -60px;
}

@media (max-width: 768px) {
    .dcard-modal-nav.prev {
        left: 10px;
    }

    .dcard-modal-nav.next {
        right: 10px;
    }

    .dcard-modal-nav {
        width: 40px;
        height: 40px;
    }
}