/**
 * Professional Bootstrap Card Styling
 * Cards Component CSS for Blog and Property Cards
 */

:root {
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --primary-gradient: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* ========================================
   General Card Styles
   ======================================== */

.transition-all {
    transition: var(--card-transition);
}

.transition-all:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover) !important;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Blog Cards
   ======================================== */

/* Blog Card Grid */
.blog-grid-wrapper {
    margin-bottom: 2rem;
}

.blog-item {
    height: 100%;
}

.blog-card-grid {
    height: 100%;
}

.blog-card-grid .card {
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

.blog-card-grid .card-img-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.blog-card-grid .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.blog-card-grid .card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.blog-card-grid .badge {
    z-index: 10;
}

.blog-card-grid .card-body {
    padding: 1.25rem;
}

.blog-card-grid .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    min-height: 2.5rem;
}

.blog-card-grid .card-title a {
    color: #1a1a1a;
    transition: color 0.3s ease;
}

.blog-card-grid .card-title a:hover {
    color: #007bff;
}

.blog-card-grid .card-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #6c757d;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.blog-card-grid .card-body .border-top {
    border-color: #e9ecef !important;
}

/* Blog Card List */
.blog-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card-list {
    margin-bottom: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--card-transition);
}

.blog-card-list:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover) !important;
}

.blog-card-list .row {
    height: 100%;
}

.blog-card-list .col-md-4 {
    overflow: hidden;
}

.blog-card-list .col-md-4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.blog-card-list:hover .col-md-4 img {
    transform: scale(1.05);
}

.blog-card-list .card-body {
    padding: 1.25rem;
}

.blog-card-list .card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.blog-card-list .card-title a {
    color: #1a1a1a;
    transition: color 0.3s ease;
}

.blog-card-list .card-title a:hover {
    color: #007bff;
}

.blog-card-list .card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6c757d;
    margin-bottom: 1rem;
}

.blog-card-list .meta-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ========================================
   Property Cards
   ======================================== */

/* Property Card Grid */
.property-grid-wrapper {
    margin-bottom: 2rem;
}

.property-item {
    height: 100%;
}

.property-card-grid {
    height: 100%;
}

.property-card-grid .card {
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--card-transition);
}

.property-card-grid .card-img-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.property-card-grid .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.property-card-grid .card:hover .card-img-wrapper img {
    transform: scale(1.1);
}

.property-card-grid .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    font-weight: 600;
}

.property-card-grid .card-body {
    padding: 1.25rem;
}

.property-card-grid .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.property-card-grid .card-title a {
    color: #1a1a1a;
    transition: color 0.3s ease;
}

.property-card-grid .card-title a:hover {
    color: #007bff;
}

.property-card-grid .property-price {
    color: #007bff;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.75rem 0;
}

.property-card-grid .btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: var(--card-transition);
}

.property-card-grid .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.property-card-grid .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
}

/* Property Card List */
.property-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.property-card-list {
    margin-bottom: 0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.property-card-list .row {
    height: 100%;
}

.property-card-list .col-md-3 {
    overflow: hidden;
}

.property-card-list .col-md-3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.property-card-list:hover .col-md-3 img {
    transform: scale(1.05);
}

.property-card-list .card-body {
    padding: 1.25rem;
}

.property-card-list .card-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.property-card-list .card-title a {
    color: #1a1a1a;
    transition: color 0.3s ease;
}

.property-card-list .card-title a:hover {
    color: #007bff;
}

.property-price {
    color: #007bff;
    font-weight: 700;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Mobile (xs) */
@media (max-width: 575.98px) {
    .blog-card-grid .card-body,
    .property-card-grid .card-body {
        padding: 1rem;
    }

    .blog-card-grid .card-title,
    .property-card-grid .card-title {
        font-size: 1rem;
    }

    .blog-card-list .col-md-4,
    .property-card-list .col-md-3 {
        min-height: 200px;
    }

    .blog-card-list .card-title {
        font-size: 1.1rem;
    }

    .property-card-list .card-title {
        font-size: 1rem;
    }
}

/* Tablet (sm) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .blog-card-grid .card-img-wrapper,
    .property-card-grid .card-img-wrapper {
        height: 220px;
    }
}

/* Large screens (lg and up) */
@media (min-width: 992px) {
    .blog-card-grid .card-img-wrapper,
    .property-card-grid .card-img-wrapper {
        height: 280px;
    }
}

/* ========================================
   Card Animations & Effects
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-item,
.property-item {
    animation: fadeInUp 0.6s ease forwards;
}

.blog-item:nth-child(1) { animation-delay: 0.1s; }
.blog-item:nth-child(2) { animation-delay: 0.2s; }
.blog-item:nth-child(3) { animation-delay: 0.3s; }
.blog-item:nth-child(4) { animation-delay: 0.4s; }
.blog-item:nth-child(5) { animation-delay: 0.5s; }
.blog-item:nth-child(6) { animation-delay: 0.6s; }

.property-item:nth-child(1) { animation-delay: 0.1s; }
.property-item:nth-child(2) { animation-delay: 0.2s; }
.property-item:nth-child(3) { animation-delay: 0.3s; }
.property-item:nth-child(4) { animation-delay: 0.4s; }
.property-item:nth-child(5) { animation-delay: 0.5s; }
.property-item:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   Dark Mode Support
   ======================================== */

@media (prefers-color-scheme: dark) {
    .blog-card-grid .card-title a,
    .property-card-grid .card-title a,
    .blog-card-list .card-title a,
    .property-card-list .card-title a {
        color: #e9ecef;
    }

    .blog-card-grid .card-text,
    .blog-card-list .card-text,
    .blog-card-list .meta-info {
        color: #adb5bd;
    }

    .blog-card-grid .card-body,
    .property-card-grid .card-body,
    .blog-card-list .card-body,
    .property-card-list .card-body {
        background-color: #fff;
    }

    .blog-card-grid .card,
    .property-card-grid .card,
    .blog-card-list,
    .property-card-list {
        border-color: #495057;
    }
}