/* ===== CARD STYLES ===== */
.consejos-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.consejos-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ===== IMAGE CONTAINER ===== */
.card-img-top-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #f8f9fa;
}

.card-img-top-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.consejos-card:hover .consejos-image {
    transform: scale(1.1);
}

/* ===== OVERLAY EFFECTS ===== */
.card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.8) 0%, rgba(0, 123, 255, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.consejos-card:hover .card-img-overlay {
    opacity: 0.9;
}

/* ===== QUICK VIEW BUTTON ===== */
.quick-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 4;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #CC0000;
    color: #CC0000;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    pointer-events: auto;
}

.consejos-card:hover .quick-view-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.quick-view-btn:hover {
    background: #CC0000;
    color: white;
    transform: translate(-50%, -50%) scale(1.05);
}

/* ===== BADGES ===== */
.category-badge {
    position: absolute;
    top: 0;
    left: 0;
    margin: 1rem;
    z-index: 5;
}

.tip-badge {
    position: absolute;
    top: 0;
    right: 0;
    margin: 1rem;
    z-index: 5;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.category-badge .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border: none;
    font-weight: 600;
}

/* ===== BADGE COLORS ===== */
.badge-paint {
    background: linear-gradient(135deg, #CC0000 0%, #c82333 100%);
    color: white;
}

.badge-waterproofing {
    background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
    color: white;
}

.badge-maintenance {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

/* ===== CARD CONTENT ===== */
.card-body {
    position: relative;
    z-index: 1;
    background: white;
}

.hover-button {
    transition: all 0.3s ease;
}

.consejos-card:hover .hover-button .btn {
    background-color: #CC0000;
    color: white;
    transform: translateY(-2px);
}

/* ===== PLACEHOLDER IMAGES ===== */
.default-tip-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 1;
}

.default-tip-image.category-paint {
    background: linear-gradient(135deg, #CC0000 0%, #c82333 100%);
}

.default-tip-image.category-waterproofing {
    background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
}

.default-tip-image.category-maintenance {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.placeholder-content {
    text-align: center;
    z-index: 2;
}

.placeholder-content i {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
    opacity: 0.9;
}

.tip-category {
    font-size: 0.9rem;
    opacity: 0.9;
    display: block;
}

/* ===== QUICK VIEW MODAL ===== */
.quick-view-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 300px;
    background: #f8f9fa;
}

.quick-view-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-view-content {
    padding: 0 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== FILTER ANIMATIONS ===== */
.consejo-item {
    display: block;
    transition: all 0.3s ease;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar-sticky {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Fixed Sticky Sidebar */
/* Fixed Sticky Sidebar - Only apply to the main container */
.sticky-sidebar {
    position: sticky;
    top: 120px; /* Account for navbar height */
    z-index: 990;
    transition: all 0.3s ease;
    height: fit-content;
    max-height: calc(100vh - 140px); /* Prevent overflow */
    overflow-y: auto; /* Allow scrolling if content is too tall */
}

/* Remove sticky from individual cards inside sidebar */
.sticky-sidebar .card {
    position: relative !important;
    top: auto !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
    /* Mobile sidebar */
    .sticky-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        overflow-y: visible;
    }
    
    /* Adjust sidebar layout */
    .sidebar-sticky {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    /* Mobile card adjustments */
    .card-img-top-container {
        height: 180px;
    }
    
    /* Mobile badge sizing */
    .tip-badge {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .category-badge .badge {
        font-size: 0.7rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .consejos-card,
    .consejos-image,
    .card-img-overlay,
    .quick-view-btn,
    .hover-button,
    .consejo-item {
        transition: none;
    }
}
