/**
 * PlekTag Advertentie Systeem - CSS Styles
 * Met afbeelding, afstand, navigatie en deal knoppen
 */

/* ========== ADVERTENTIE CONTAINER ========== */

.ad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: calc(var(--pt-spacing-unit) * 2) 0;
    padding: 0 var(--pt-spacing-unit);
}

/* ========== ADVERTENTIE KAART ========== */

.ad-card {
    max-width: 340px;
    width: 100%;
    background: var(--pt-background-card);
    border-radius: var(--pt-border-radius-large);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--pt-border-color);
}

.ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Advertentie afbeelding */
.ad-card-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Advertentie info sectie */
.ad-card-info {
    padding: 12px 14px 14px;
}

.ad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.ad-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pt-text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-card-distance {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pt-brand-blue);
    flex-shrink: 0;
    padding: 4px 10px;
    background: rgba(59, 152, 211, 0.15);
    border-radius: var(--pt-border-radius-small);
}

/* Advertentie knoppen */
.ad-card-actions {
    display: flex;
    gap: 10px;
}

.ad-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    border-radius: var(--pt-border-radius-medium);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ad-btn i {
    font-size: 0.9rem;
}

/* PLEK = GROEN - Navigatie, locatie */
.ad-btn-navigate {
    background: var(--pt-brand-green);
    color: white;
}

.ad-btn-navigate:hover {
    background: var(--pt-brand-green-darker, #7ba83d);
    transform: scale(1.02);
}

.ad-btn-navigate:active {
    transform: scale(0.98);
}

/* TAG = BLAUW - Deals, links, tags */
.ad-btn-deal {
    background: var(--pt-brand-blue);
    color: white;
}

.ad-btn-deal:hover {
    background: var(--pt-brand-blue-darker, #2d7bb8);
    transform: scale(1.02);
}

.ad-btn-deal:active {
    transform: scale(0.98);
}

/* Fallback voor oude ad-image-only class */
.ad-image-only {
    max-width: 320px;
    width: 100%;
    height: auto;
    border-radius: var(--pt-border-radius-medium);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}

.ad-image-only:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.ad-image-only:active {
    transform: scale(0.98);
}

/* ========== CODE MODAL (QR/Barcode) ========== */

.ad-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.ad-code-modal-content {
    background: var(--pt-background-card);
    border-radius: var(--pt-border-radius-large);
    max-width: 350px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ad-code-modal-content .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
    z-index: 10;
}

.ad-code-modal-content .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--pt-brand-green), var(--pt-brand-green-darker));
    padding: 25px 20px;
    text-align: center;
}

.modal-header h2 {
    color: white;
    font-size: 1.3rem;
    margin: 0 0 5px;
}

.modal-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
}

.modal-body {
    padding: 25px 20px;
    text-align: center;
}

.offer-description {
    color: var(--pt-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.code-container {
    background: var(--pt-background-input);
    border-radius: var(--pt-border-radius-medium);
    padding: 20px;
    margin-bottom: 15px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-loading {
    color: var(--pt-text-secondary);
    font-size: 0.9rem;
}

.code-loading i {
    margin-right: 8px;
}

.qr-code {
    max-width: 180px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-code.loaded {
    opacity: 1;
}

.barcode-container {
    text-align: center;
}

.barcode {
    width: 100%;
    max-width: 200px;
    height: 80px;
    background: var(--pt-background-body);
    border-radius: 4px;
}

.barcode-text {
    display: block;
    margin-top: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--pt-text-primary);
    letter-spacing: 2px;
}

.code-text {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(153, 194, 76, 0.1);
    border-radius: var(--pt-border-radius-small);
    border: 1px dashed var(--pt-brand-green);
}

.code-label {
    color: var(--pt-text-secondary);
    font-size: 0.8rem;
}

.code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pt-brand-green);
    letter-spacing: 1px;
}

.modal-footer {
    padding: 15px 20px;
    background: var(--pt-background-component);
    border-top: 1px solid var(--pt-border-color);
    text-align: center;
}

.validity-info {
    color: var(--pt-text-secondary);
    font-size: 0.75rem;
    margin: 0;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 400px) {
    .ad-card {
        max-width: 100%;
    }
    
    .ad-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .ad-card-distance {
        align-self: flex-end;
    }
    
    .ad-card-actions {
        flex-direction: column;
    }
    
    .ad-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .ad-image-only {
        max-width: 100%;
    }
    
    .ad-code-modal-content {
        margin: 10px;
    }
    
    .ad-card-info {
        padding: 10px 12px 12px;
    }
    
    .ad-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}
