:root {
    --primary-green: #5fbb76;
    --hover-green: #4ba262;
    --text-green: #4a6b2f;
    --font-size-small: 13px;
    --font-size-medium: 14px;
    --font-size-title: 16px;
    --font-size-large: 18px;
    --font-size-xlarge: 20px;
    --font-size-xxlarge: 24px;
    --border-radius-small: 4px;
    --border-radius-medium: 8px;
    --border-radius-large: 12px;
    --border-radius-xlarge: 16px;
    --box-shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
    --box-shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.08);
    --box-shadow-heavy: 0 12px 40px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== BASE STYLES & RESETS ===== */
.fallback-colors {
    color: var(--text-green);
    font-size: var(--font-size-small);
}

.project-card-home,
.project-card-home *,
.search-form-inline,
.search-form-inline * {
    text-decoration: none !important;
}

/* ===== RESPONSIVE GRID LAYOUT SYSTEM ===== */
.homepage-grid,
.projects-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

/* Mobile phones - 1 card per row */
@media (max-width: 767px) {
    .homepage-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Tablets - 2 cards per row */
@media (min-width: 768px) and (max-width: 1023px) {
    .homepage-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

/* Large tablets - 3 cards per row */
@media (min-width: 900px) and (max-width: 1023px) {
    .homepage-grid,
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop - 4 cards per row */
@media (min-width: 1024px) {
    .homepage-grid,
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Fallback for older browsers */
@supports not (display: grid) {
    .homepage-grid,
    .projects-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .project-card-home {
        flex: 1 1 calc(25% - 16px);
        min-width: 200px;
    }
    
    @media (max-width: 768px) {
        .project-card-home {
            flex: 1 1 calc(50% - 16px);
        }
    }
    
    @media (max-width: 480px) {
        .project-card-home {
            flex: 1 1 100%;
        }
    }
}

/* ===== PROJECT CARD COMPONENT ===== */
.project-card-home {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-xlarge);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--box-shadow-medium);
    transition: all var(--transition-medium) cubic-bezier(0.4, 0, 0.2, 1);
    color: inherit;
    position: relative;
    height: 100%;
}

.project-card-home:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-heavy);
    border-color: var(--primary-green);
}

/* Featured card variation */
.featured-card {
    border: 2px solid var(--primary-green);
    background: linear-gradient(135deg, #fff 0%, #f8fff9 100%);
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: var(--font-size-small);
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.featured-badge i {
    margin-right: 4px;
}

/* Card image container */
.card-image-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-medium);
}

.project-card-home:hover .card-image-container img {
    transform: scale(1.05);
}

/* Card overlay effect */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(95, 187, 118, 0.9), rgba(75, 162, 98, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.project-card-home:hover .card-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
    font-weight: 600;
}

.overlay-content i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

/* Card content sections */
.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    margin-bottom: 16px;
}

.card-title {
    font-size: var(--font-size-large);
    font-weight: 700;
    color: var(--text-green);
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: var(--font-size-xlarge);
    font-weight: 800;
    color: var(--primary-green);
    background: linear-gradient(135deg, var(--primary-green), var(--hover-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-details {
    flex: 1;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: var(--font-size-medium);
    color: #666;
}

.detail-item i {
    width: 18px;
    margin-right: 10px;
    color: var(--primary-green);
    text-align: center;
}

.detail-item.location i {
    color: #e74c3c;
}

.detail-item.category i {
    color: #3498db;
}

/* Property features */
.property-features {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.feature-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-small);
    color: #777;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
}

.feature-item i {
    margin-right: 6px;
    color: var(--primary-green);
}

/* Card footer */
.card-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
}

.view-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-medium);
    font-weight: 600;
    color: var(--primary-green);
    transition: color var(--transition-medium);
}

.project-card-home:hover .view-more {
    color: var(--hover-green);
}

.view-more i {
    transition: transform var(--transition-medium);
}

.project-card-home:hover .view-more i {
    transform: translateX(4px);
}

/* Mobile responsive adjustments for cards */
@media (max-width: 767px) {
    .card-image-container {
        height: 180px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .card-title {
        font-size: var(--font-size-title);
    }
    
    .card-price {
        font-size: var(--font-size-large);
    }
    
    .property-features {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== CUSTOM ACTION BUTTONS ===== */
.custom-action-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    padding: 0 1rem;
}

.custom-action-buttons .action-btn {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    border: none;
    border-radius: var(--border-radius-large);
    padding: 0.8rem 1rem;
    text-align: center;
    transition: all var(--transition-medium);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.custom-action-buttons .action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.custom-action-buttons .action-btn a {
    color: white;
    font-weight: 600;
    font-size: var(--font-size-title);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}

.custom-action-buttons .action-btn a i {
    margin-right: 8px;
}

/* Specific button styles */
.custom-action-buttons .btn-post {
    background: linear-gradient(to right, #4a7c2a, var(--primary-green));
}

.custom-action-buttons .btn-why {
    background: linear-gradient(to right, #2d5016, #4a7c2a);
}

/* Responsive adjustments for buttons */
@media (max-width: 768px) {
    .custom-action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        margin: 1.5rem auto;
    }
    
    .custom-action-buttons .action-btn {
        min-width: 120px;
        padding: 0.7rem 0.8rem;
    }
    
    .custom-action-buttons .action-btn a {
        font-size: var(--font-size-medium);
    }
}

@media (max-width: 480px) {
    .custom-action-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .custom-action-buttons .action-btn {
        max-width: 100%;
        width: 100%;
    }
}

/* ===== SEARCH FORM ===== */
.search-form-wrapper {
    background: #f0fff4;
    border: 2px solid #a8e6a3;
    border-radius: var(--border-radius-large);
    padding: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.1);
    max-width: 950px;
    margin: auto;
}

.search-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    align-items: center;
}

.search-form-inline select,
.search-form-inline button {
    padding: 0.5rem 0.8rem;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--primary-green);
    font-size: 0.9rem;
    background: white;
}

/* ===== UTILITY CLASSES ===== */
.no-projects {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius-xlarge);
    margin: 40px 0;
}

.no-projects h3 {
    font-size: var(--font-size-xxlarge);
    color: var(--text-green);
    margin-bottom: 12px;
}

.no-projects p {
    color: #666;
    font-size: var(--font-size-title);
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 20px;
    border-radius: var(--border-radius-medium);
    margin: 20px 0;
    text-align: center;
}

.error-message i {
    margin-right: 8px;
}