/* Custom Color Palette from Style Guide */
:root {
    --color-cream: #f9f4e1;
    --color-light-tan: #d8ac87;
    --color-medium-tan: #c29b74;
    --color-dark-brown: #88693d;
    --color-light-olive: #a9ab7a;
    --color-dark-olive: #7e8156;
    --color-white: #ffffff;
    --color-light-gray: #f8f9fa;
    --color-gray: #6c757d;
    --color-dark: #343a40;
}

/* Typography */
body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-cream);
    color: var(--color-dark);
    line-height: 1.6;
}

.brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    color: var(--color-dark-brown);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, 'Times New Roman', Times, serif;
    color: var(--color-dark-brown);
}

/* Login Pages */

.auth-container {
    background-color: linear-gradient(to right, var(--color-light-tan), var(--color-medium-tan));
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}


/* Navigation */
.navbar {
    background-color: var(--color-white) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--color-light-tan);
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    color: var(--color-dark-brown) !important;
}

.navbar-brand:hover {
    color: var(--color-medium-tan) !important;
}

.nav-link {
    color: var(--color-dark-brown) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-medium-tan) !important;
}

/* Buttons - Flat Design */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    padding: 8px 16px;
}

.btn-primary {
    background-color: var(--color-dark-brown);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-medium-tan);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--color-dark-brown);
    color: var(--color-dark-brown);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--color-dark-brown);
    color: var(--color-white);
}

.btn-secondary {
    background-color: var(--color-light-olive);
    color: var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-dark-olive);
}

/* Community Page Layout */
.community-page {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

/* Sidebar Styling */
.sidebar-left, .sidebar-right {
    position: sticky;
    top: 20px;
}

.sidebar-header {
    background-color: var(--color-light-tan);
    padding: 15px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.sidebar-title {
    margin: 0;
    color: var(--color-white);
    font-size: 1.2rem;
}

.sidebar-content {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Community Links */
.community-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.community-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--color-cream);
    color: var(--color-dark-brown);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.community-link:hover {
    background-color: var(--color-light-tan);
    color: var(--color-white);
    transform: translateX(5px);
    text-decoration: none;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 0;
    margin: 0;
}

.newsfeed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-cream);
}

.newsfeed-title {
    margin: 0;
    color: var(--color-dark-brown);
}

/* Create Post Section */
.create-post-section {
    margin-bottom: 30px;
}

.create-post-section .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.create-post-section .card-body {
    padding: 20px;
}

/* Post Cards */
.post-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.post-card .card-body {
    padding: 20px;
}

.post-card h5 {
    color: var(--color-dark-brown);
    margin-bottom: 10px;
}

.post-card p {
    color: var(--color-dark);
    margin-bottom: 15px;
}

/* Preserve user-entered line breaks in post text */
.post-text {
    white-space: pre-line;
}

/* Profile Section */
.profile-section {
    margin-bottom: 20px;
}

.profile-section .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-light-tan), var(--color-medium-tan));
    color: var(--color-white);
}

.profile-section .card-body {
    padding: 20px;
}

.profile-section h5 {
    color: var(--color-white);
    margin-bottom: 10px;
}

/* Ads Section */
.ads-section .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.ads-section .card-header {
    background-color: var(--color-light-olive);
    color: var(--color-white);
    border-radius: 10px 10px 0 0;
    border: none;
}

.ads-section .card-body {
    padding: 20px;
}

.ad-item {
    margin-bottom: 15px;
}

.ad-item:last-child {
    margin-bottom: 0;
}

.ad-item h6 {
    color: var(--color-dark-brown);
    margin-bottom: 5px;
}

.ad-item p {
    color: var(--color-gray);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    background-color: var(--color-light-tan);
    color: var(--color-white);
    border-radius: 10px 10px 0 0;
    border: none;
}

/* Form Elements */
.form-control {
    border: 2px solid var(--color-cream);
    border-radius: 8px;
    padding: 10px 15px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--color-medium-tan);
    box-shadow: 0 0 0 0.2rem rgba(194, 155, 116, 0.25);
}

.form-select {
    border: 2px solid var(--color-cream);
    border-radius: 8px;
    padding: 10px 15px;
}

.form-select:focus {
    border-color: var(--color-medium-tan);
    box-shadow: 0 0 0 0.2rem rgba(194, 155, 116, 0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: var(--color-light-olive);
    color: var(--color-white);
}

.alert-danger {
    background-color: #dc3545;
    color: var(--color-white);
}

.alert-info {
    background-color: var(--color-light-tan);
    color: var(--color-white);
}

/* Footer */
.footer {
    background-color: var(--color-dark-brown);
    color: var(--color-white);
    margin-top: 50px;
}

.footer h5, .footer h6 {
    color: var(--color-white);
}

.footer a {
    color: var(--color-light-tan);
    text-decoration: none;
}

.footer a:hover {
    color: var(--color-white);
}

/* Responsive Design */
@media (max-width: 768px) {
    .community-page {
        padding: 10px 0;
    }
    
    .sidebar-left, .sidebar-right {
        position: static;
        margin-bottom: 20px;
    }
    
    .newsfeed-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .main-content {
        padding: 0;
    }
    
    .sidebar-content {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0 10px;
    }
    
    .post-card .card-body {
        padding: 15px;
    }
    
    .create-post-section .card-body {
        padding: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--color-medium-tan);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-dark-brown);
}

/* Comment System Styles */
.comments-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--color-white);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.comments-header h6 {
    margin: 0;
    color: var(--color-dark);
    font-weight: 600;
}

.close-comments {
    background: none;
    border: none;
    color: var(--color-gray);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.close-comments:hover {
    color: var(--color-dark);
}

.comment-form {
    margin-bottom: 1.5rem;
}

.comment-input {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.comment-input:focus {
    border-color: var(--color-light-olive);
    box-shadow: 0 0 0 0.2rem rgba(169, 171, 122, 0.25);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.post-comment-btn {
    background: var(--color-light-olive);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.post-comment-btn:hover {
    background: var(--color-dark-olive);
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.comment-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--color-light-olive);
}

.comment-item.reply-item {
    margin-left: 2rem;
    background: white;
    border-left-color: var(--color-light-tan);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar .avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-avatar .avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-light-olive);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.comment-meta {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: var(--color-dark);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--color-gray);
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.comment-content {
    color: var(--color-dark);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    /* Preserve user-entered line breaks in comments */
    white-space: pre-line;
}

.comment-edit-form {
    margin-bottom: 0.75rem;
}

.edit-comment-input {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-actions .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.comment-replies {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
}

.loading-comments {
    text-align: center;
    padding: 2rem;
    color: var(--color-gray);
}

.loading-comments i {
    margin-right: 0.5rem;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--color-gray);
    font-style: italic;
}

.error-loading-comments {
    text-align: center;
    padding: 1rem;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

/* Comment button styling */
.comment-btn {
    transition: all 0.2s;
}

.comment-btn:hover {
    background: var(--color-light-olive);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comment-item.reply-item {
        margin-left: 1rem;
    }
    
    .comment-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .comment-actions {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }
}

/* Vendor Directory Styles */
.vendor-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.vendor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.vendor-card.spotlight {
    border: 2px solid var(--color-light-olive);
    box-shadow: 0 6px 20px rgba(169, 171, 122, 0.3);
}

.spotlight-badge {
    background: linear-gradient(135deg, var(--color-light-olive), var(--color-dark-olive));
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.vendor-content {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.vendor-image {
    flex-shrink: 0;
}

.vendor-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid var(--color-light-tan);
}

.vendor-info {
    flex: 1;
}

.vendor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.vendor-name {
    margin: 0;
    color: var(--color-dark-brown);
    font-size: 1.5rem;
}

.verified-badge {
    background: var(--color-light-olive);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.vendor-description {
    margin-bottom: 1rem;
    color: var(--color-gray);
    line-height: 1.6;
}

.vendor-details {
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-gray);
}

.detail-item i {
    color: var(--color-medium-tan);
    width: 16px;
}

.star-rating {
    display: inline-flex;
    gap: 2px;
    margin-left: 0.5rem;
}

.star {
    color: #ddd;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.star.filled {
    color: #ffc107;
}

.star.hover {
    color: #ffc107;
}

.vendor-services {
    margin-bottom: 1rem;
}

.services-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.service-tag {
    background: var(--color-light-tan);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.vendor-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rate-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.star-rating-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.star-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn .star {
    font-size: 1.2rem;
}

.rating-text {
    margin-left: 0.5rem;
    color: var(--color-gray);
    font-size: 0.9rem;
}

.login-required {
    margin-top: 0.5rem;
}

.vendor-links {
    display: flex;
    gap: 0.5rem;
}

.learn-more-section {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.learn-more-btn {
    width: 100%;
    transition: all 0.3s ease;
}

.expanded-content {
    display: none;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.expanded-details {
    margin-bottom: 1.5rem;
}

.extended-description h5 {
    color: var(--color-dark-brown);
    margin-bottom: 1rem;
}

.extended-description p {
    color: var(--color-gray);
    line-height: 1.6;
}

.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.results-header {
    margin-bottom: 1.5rem;
}

.results-header h3 {
    color: var(--color-dark-brown);
    margin: 0;
}

.vendors-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--color-gray);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--color-light-tan);
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vendor-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vendor-img {
        width: 100px;
        height: 100px;
    }
    
    .vendor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .vendor-actions {
        flex-direction: column;
    }
}

/* Notification Styles */
.notification {
    animation: slideInRight 0.3s ease;
}

.notification-enter {
    transform: translateX(100%);
}

.notification-exit {
    transform: translateX(100%);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Enhanced Star Rating Styles */
.star-btn {
    position: relative;
    overflow: hidden;
}

.star-btn.rated {
    animation: ratingPulse 0.6s ease;
}

@keyframes ratingPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.star-btn .star {
    transition: all 0.2s ease;
}

.star-btn:hover .star {
    transform: scale(1.1);
}

.star.filled {
    color: #ffc107;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

.star.hover {
    color: #ffc107;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

/* Filter form improvements */
.filter-form select {
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.filter-form select:focus {
    border-color: var(--color-light-olive);
    box-shadow: 0 0 0 0.2rem rgba(169, 171, 122, 0.25);
}

/* Page Header - unified brand styling (used across pages) */
.page-header {
    background: var(--color-white);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--color-dark-brown);
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header i {
    color: var(--color-light-tan);
    margin-right: 0.5rem;
}

.page-header p {
    color: var(--color-gray);
    margin: 0;
}

/* Coupon input group - prevent collapse on mobile */
.coupon-form .input-group,
.coupon-section .input-group {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    gap: 8px;
}

.coupon-form .input-group .form-control,
.coupon-section .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.coupon-form .input-group .btn,
.coupon-section .input-group .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    height: auto;
}

@media (max-width: 576px) {
    .coupon-form .input-group .form-control,
    .coupon-section .input-group .form-control,
    .coupon-form .input-group .btn,
    .coupon-section .input-group .btn {
        min-height: 44px;
    }
}

/* Extra specificity to counteract any overrides causing stack/collapse */
.coupon-form .input-group,
.coupon-section .input-group {
    flex-direction: row !important;
}

.coupon-form .input-group .form-control,
.coupon-section .input-group .form-control {
    width: auto !important;
    flex: 1 1 auto !important;
}

.coupon-form .input-group .btn,
.coupon-section .input-group .btn {
    width: auto !important;
    display: inline-flex !important;
}

