/**
 * Demo Library Styles
 *
 * @package Versana Companion
 * @since 1.0.0
 */

/* ============================================================
   Demo Library Grid
   ============================================================ */

.versana-demo-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* ============================================================
   Demo Item Card
   ============================================================ */

.versana-demo-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.versana-demo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.versana-demo-item.importing {
    opacity: 0.6;
    pointer-events: none;
}

/* Imported demo — green border */
.versana-demo-item.demo-imported {
    border-color: #4CAF50;
    background: #f0f9f0;
}

/* ============================================================
   PRO Teaser Card
   Informational only — distinct visual treatment, fully interactive.
   ============================================================ */

.versana-demo-pro-teaser {
    border-color: #c8a84b;
    background: #fffdf5;
}

.versana-demo-pro-teaser:hover {
    border-color: #b8942e;
    box-shadow: 0 5px 15px rgba(200, 168, 75, 0.2);
}

/* ============================================================
   Thumbnail
   ============================================================ */

.demo-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%;
    overflow: hidden;
    background: #f5f5f5;
}

.demo-thumbnail img,
.demo-thumbnail svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.demo-thumbnail-placeholder .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #ccc;
}

/* ============================================================
   Badges
   ============================================================ */

/* "Imported" badge */
.demo-imported-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
}

.demo-imported-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* "PRO" badge (top-right corner of thumbnail) */
.versana-pro-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #c8a84b 0%, #a07830 100%);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* ============================================================
   Import Progress Bar
   ============================================================ */

.demo-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.demo-progress-bar {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.demo-progress-fill {
    height: 100%;
    background: #1A73E8;
    width: 0%;
    transition: width 0.3s ease;
    animation: versana-progress-pulse 1.5s infinite;
}

@keyframes versana-progress-pulse {
    0%   { width: 0%; }
    50%  { width: 70%; }
    100% { width: 100%; }
}

.demo-progress-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================================
   Demo Info
   ============================================================ */

.demo-info {
    padding: 20px;
    flex: 1;
}

.demo-name {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.demo-description {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.demo-features {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.demo-features li {
    font-size: 13px;
    color: #555;
    padding: 2px 0;
}

/* ============================================================
   Import Options Checkboxes
   ============================================================ */

.demo-import-options {
    padding: 0 20px 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.demo-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.demo-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.demo-checkbox:hover {
    color: #333;
}

/* ============================================================
   Actions Row
   ============================================================ */

.demo-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.demo-actions .button {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.demo-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.demo-actions .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* "Get Versana PRO" button — warm gold, inviting */
.versana-get-pro-btn {
    background: linear-gradient(135deg, #c8a84b 0%, #a07830 100%) !important;
    border-color: #a07830 !important;
    color: #fff !important;
    font-weight: 600;
}

.versana-get-pro-btn:hover,
.versana-get-pro-btn:focus {
    background: linear-gradient(135deg, #d4b558 0%, #b08840 100%) !important;
    border-color: #b08840 !important;
    color: #fff !important;
}

/* ============================================================
   PRO Upsell Banner (above demo grid)
   ============================================================ */

.versana-pro-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.versana-pro-notice-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.versana-pro-notice h3 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.versana-pro-notice h3 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.versana-pro-notice p {
    margin: 0 0 20px;
    font-size: 16px;
    opacity: 0.95;
}

.versana-pro-notice .button {
    margin: 0 5px;
}

.versana-pro-notice .button-primary {
    background: #fff;
    color: #667eea;
    border: none;
    font-weight: 600;
    padding: 10px 25px;
    height: auto;
}

.versana-pro-notice .button-primary:hover {
    background: #f0f0f0;
    color: #5568d3;
}

.versana-pro-notice .button:not(.button-primary) {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    padding: 10px 25px;
    height: auto;
}

.versana-pro-notice .button:not(.button-primary):hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   Import Notices
   ============================================================ */

#versana-import-notices {
    margin-bottom: 20px;
}

#versana-import-notices .notice {
    margin: 5px 0 15px;
    padding: 12px;
}

#versana-import-notices .notice p {
    margin: 0.5em 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 782px) {
    .versana-pro-notice {
        padding: 20px;
    }

    .versana-pro-notice h3 {
        font-size: 20px;
    }
}

@media screen and (max-width: 782px) {
    .versana-demo-library {
        grid-template-columns: 1fr;
    }

    .demo-actions {
        flex-direction: column;
    }

    .demo-actions .button {
        width: 100%;
    }
}