﻿.ad-card-wrapper {
    height: 100%;
}

.article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    cursor: pointer;
}

    .article-card-link:hover {
        text-decoration: none;
        color: inherit;
    }

.ad-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

    .ad-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

/* Desktop: Action Overlay - Covers entire card on hover */
.ad-actions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    place-items: center;
}

/* Desktop: Show overlay on hover */
@media (min-width: 768px) {
    .ad-card:hover .ad-actions-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hide mobile buttons on desktop */
    .ad-actions-mobile {
        display: none !important;
    }
}

/* Desktop: Overlay button styling - Smaller square buttons */
.ad-actions-overlay .btn {
    font-size: 0.75rem;
    padding: 0.6rem;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    white-space: nowrap;
    /* Make buttons smaller but still square */
    width: 85%;
    height: 85%;
    max-width: 100px;
    max-height: 100px;
    aspect-ratio: 1 / 1;
}

.ad-actions-overlay .btn i {
    font-size: 1.3rem;
    margin: 0;
    flex-shrink: 0;
}

.ad-actions-overlay .btn .btn-text {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.1;
}

/* Mobile: Hide desktop overlay, show bottom buttons */
@media (max-width: 767.98px) {
    .ad-actions-overlay {
        display: none !important;
    }
    
    .ad-actions-mobile {
        display: grid !important;
    }
}

/* Mobile: Bottom action buttons - Force equal sizing */
.ad-actions-mobile {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    padding: 0.5rem;
    background: white;
    border-top: 1px solid #f1f3f4;
}

.ad-actions-mobile .btn {
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* Force square aspect ratio */
    width: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
}

.ad-actions-mobile .btn i {
    font-size: 1.2rem;
    margin: 0;
}

/* Extra small screens (480px - 768px) */
@media (max-width: 767.98px) and (min-width: 480px) {
    .ad-actions-mobile {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    
    .ad-actions-mobile .btn i {
        font-size: 1.2rem;
    }
}

/* Small screens (360px - 479px) */
@media (max-width: 479.98px) and (min-width: 360px) {
    .ad-actions-mobile {
        padding: 0.4rem;
        gap: 0.3rem;
    }
    
    .ad-actions-mobile .btn {
        border-radius: 6px;
    }
    
    .ad-actions-mobile .btn i {
        font-size: 1rem;
    }
}

/* Very small screens (<360px) */
@media (max-width: 359.98px) {
    .ad-actions-mobile {
        padding: 0.3rem;
        gap: 0.25rem;
    }
    
    .ad-actions-mobile .btn {
        border-radius: 6px;
    }
    
    .ad-actions-mobile .btn i {
        font-size: 0.9rem;
    }
}

/* Modern Professional Color Scheme - Monochromatic Blues & Purples */
.stats-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.stats-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.edit-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: white !important;
    border: none !important;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #3d8dd5 0%, #00d3e6 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.advertise-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    border: none !important;
}

.advertise-btn:hover {
    background: linear-gradient(135deg, #d67ce3 0%, #dd4a5e 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    color: white !important;
    border: none !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #e15b82 0%, #e6c936 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250, 112, 154, 0.4);
}

/* Alternative: Professional Solid Colors (Uncomment to use) */
/*
.stats-btn {
    background-color: #6366f1 !important;
    color: white !important;
}

.stats-btn:hover {
    background-color: #4f46e5 !important;
}

.edit-btn {
    background-color: #3b82f6 !important;
    color: white !important;
}

.edit-btn:hover {
    background-color: #2563eb !important;
}

.advertise-btn {
    background-color: #8b5cf6 !important;
    color: white !important;
}

.advertise-btn:hover {
    background-color: #7c3aed !important;
}

.delete-btn {
    background-color: #ec4899 !important;
    color: white !important;
}

.delete-btn:hover {
    background-color: #db2777 !important;
}
*/

.ad-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ad-card:hover .ad-image {
    transform: scale(1.05);
}

.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 5;
}

.badge-hit {
    background: #dc3545;
}

.badge-sale {
    background: #28a745;
}

.badge-top {
    background: #ffc107;
    color: #000;
}

.badge-new {
    background: #17a2b8;
}

.badge-default {
    background: #6c757d;
}

.badge-finished {
    background: #ca3737;
}

.ad-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
}

/* Rental Indicator - More prominent badge */
.ad-rental-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-rental-indicator i {
    font-size: 0.9rem;
}

.ad-card:hover .ad-rental-indicator {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

@media (max-width: 576px) {
    .ad-rental-indicator {
        padding: 4px 8px;
        font-size: 0.7rem;
        border-radius: 4px;
    }
    
    .ad-rental-indicator i {
        font-size: 0.8rem;
    }
}

.ad-favorite {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

    .ad-favorite:hover {
        background: #ff6b6b;
        color: white;
    }

.ad-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-location {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
}

    .ad-location i {
        margin-right: 4px;
    }

.ad-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.tag {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #495057;
    border: 1px solid #e9ecef;
}

.ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f3f4;
}

.ad-time {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

    .ad-time i {
        margin-right: 4px;
    }

.ad-price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ad-price-label {
    font-size: 0.7rem;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: -2px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    padding: 2px 6px;
    border-radius: 4px;
}

.ad-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.empty-state {
    padding: 3rem 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ad-image-container {
        height: 160px;
    }

    .ad-content {
        padding: 12px;
    }

    .ad-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .ad-card {
        border-radius: 8px;
    }

    .ad-image-container {
        height: 140px;
    }
}

.ad-favorite .bi.bi-heart {
    margin-top: 3px;
}

/* Subtle highlight for advertised articles */
.ad-card--advertised {
    border: 2px solid rgba(139, 92, 246, 0.75); /* stronger purple */
    box-shadow:
        0 0.75rem 1.75rem rgba(139, 92, 246, 0.22),
        0 0 0 0.25rem rgba(139, 92, 246, 0.10);

    /* Purple gradient from left -> right (slightly darker) */
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.26) 0%, rgba(255, 255, 255, 0) 70%);

    transform: translateY(-1px);
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.ad-card--advertised:hover {
    border-color: rgba(139, 92, 246, 0.92);
    box-shadow:
        0 1.1rem 2.2rem rgba(139, 92, 246, 0.30),
        0 0 0 0.35rem rgba(139, 92, 246, 0.14);

    /* Slightly stronger on hover, still left -> right (slightly darker) */
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.32) 0%, rgba(255, 255, 255, 0) 75%);

    transform: translateY(-3px);
}

/* "Izdvojeno" pill */
.ad-sponsored-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.28);
    z-index: 4;
}

@media (max-width: 576px) {
    .ad-sponsored-indicator {
        top: 8px;
        right: 8px;
        padding: 4px 10px;
        font-size: 11px;
    }
}

.ad-sponsored-indicator i {
    font-size: 12px;
    line-height: 1;
}