/* =====================================================
   COMPLAINT PAGE STYLES - Matches your theme
===================================================== */

.complaint-content {
    padding: 40px 20px;
}

.complaint-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.complaint-form-card,
.complaint-history-card {
    background: var(--off-white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    border: 2px solid var(--border);
}

.complaint-form-card h2,
.complaint-history-card h2 {
    margin-bottom: 15px;
    color: var(--primary-brown);
}

.complaint-form-card p {
    margin-bottom: 25px;
    color: var(--text-dark);
    opacity: 0.9;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-brown);
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--white);
    font-size: 16px;
    transition: var(--transition);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-brown);
    box-shadow: 0 0 0 4px rgba(150, 114, 89, 0.15);
}

.required {
    color: var(--error);
}

/* Complaint History */
.complaint-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.complaint-item {
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    border-left: 5px solid var(--accent-brown);
    box-shadow: 0 4px 15px var(--shadow);
}

.complaint-item.open { border-left-color: var(--warning); }
.complaint-item.in_progress { border-left-color: var(--info); }
.complaint-item.resolved { border-left-color: var(--success); }

.complaint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.complaint-id {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-brown);
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.open { background: #fff3cd; color: #856404; }
.status-badge.in_progress { background: #d1ecf1; color: #0c5460; }
.status-badge.resolved { background: #d4edda; color: #155724; }

.complaint-msg,
.complaint-time {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.6;
}

.admin-response {
    margin-top: 15px;
    padding: 15px;
    background: var(--beige);
    border-radius: 12px;
    border-left: 4px solid var(--primary-brown);
}

.admin-response strong {
    color: var(--primary-brown);
}

.complaint-note {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background: var(--beige);
    border-radius: 16px;
    font-size: 16px;
}

.complaint-note a {
    color: var(--primary-brown);
    font-weight: 600;
    text-decoration: underline;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dark);
    opacity: 0.7;
}

.empty i {
    font-size: 60px;
    margin-bottom: 20px;
    color: var(--accent-brown);
}

/* Responsive */
@media (max-width: 992px) {
    .complaint-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .complaint-form-card,
    .complaint-history-card {
        padding: 20px;
    }
    .complaint-item {
        padding: 16px;
    }
}
.admin-response.in-progress,
.admin-response.resolved {
    background: #e8f5e9;
    border-left: 4px solid var(--success);
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-style: italic;
}

.admin-response.in-progress {
    background: #fff8e1;
    border-left-color: var(--warning);
}
/* Accordion Styles */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.accordion-item {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
    border-left: 5px solid var(--accent-brown);
    overflow: hidden;
}

.accordion-item.open { border-left-color: var(--warning); }
.accordion-item.read,
.accordion-item.in_progress { border-left-color: var(--info); }
.accordion-item.replied,
.accordion-item.resolved { border-left-color: var(--success); }

.accordion-header {
    padding: 18px 20px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #f9f9f9;
}

.accordion-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.accordion-summary .complaint-id {
    font-weight: 700;
    font-size: 17px;
    color: var(--primary-brown);
}

.accordion-date {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

.accordion-icon {
    font-size: 16px;
    color: var(--primary-brown);
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 20px;
    background: var(--off-white);
}

.accordion-item.active .accordion-body {
    max-height: 600px; /* Adjust if needed for very long messages */
    padding: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .accordion-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .accordion-date {
        margin-left: 0;
    }
}

/* =====================================================
   CONTACT PAGE - ENHANCEMENTS
===================================================== */

/* 1. Scrollable Message History (Accordion Container) */
.contact-info-card .accordion-container {
    max-height: 600px;                /* Limit height - adjust as needed */
    overflow-y: auto;                 /* Enable vertical scrollbar when content overflows */
    padding-right: 8px;               /* Small space for scrollbar */
    margin-top: 20px;
}

/* Custom scrollbar styling (WebKit browsers - Chrome, Edge, Safari) */
.contact-info-card .accordion-container::-webkit-scrollbar {
    width: 10px;
}

.contact-info-card .accordion-container::-webkit-scrollbar-track {
    background: var(--off-white);
    border-radius: 10px;
}

.contact-info-card .accordion-container::-webkit-scrollbar-thumb {
    background: var(--accent-brown);
    border-radius: 10px;
    border: 2px solid var(--off-white);
}

.contact-info-card .accordion-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-brown);
}

/* Firefox scrollbar styling (limited support) */
.contact-info-card .accordion-container {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-brown) var(--off-white);
}

/* Optional: Add subtle shadow at bottom when scrolled */
.contact-info-card .accordion-container {
    position: relative;
}

.contact-info-card .accordion-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, var(--off-white));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.contact-info-card .accordion-container:hover::after {
    opacity: 1;
}

/* 2. Enhanced "Get in Touch" Section Styling */
.get-in-touch-section {
    grid-column: 1 / -1; /* Full width */
    margin-top: 60px;
    padding: 40px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 12px 32px var(--shadow);
    text-align: center;
    border: 2px solid var(--border);
}

.get-in-touch-section h3 {
    font-size: 32px;
    color: var(--primary-brown);
    margin-bottom: 16px;
    font-weight: 700;
}

.get-in-touch-section > p {
    font-size: 18px;
    color: var(--text-dark);
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto 40px auto;
    line-height: 1.7;
}

.location-box {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: var(--beige);
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--shadow);
    font-size: 18px;
    margin-top: 20px;
    border-left: 5px solid var(--accent-brown);
}

.location-box i {
    font-size: 32px;
    color: var(--accent-brown);
}

.location-box strong {
    display: block;
    color: var(--primary-brown);
    font-size: 20px;
    margin-bottom: 4px;
}

.location-box br {
    display: none; /* Cleaner layout */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .get-in-touch-section {
        padding: 30px 20px;
    }

    .get-in-touch-section h3 {
        font-size: 28px;
    }

    .location-box {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .location-box i {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .contact-info-card .accordion-container {
        max-height: 500px; /* Slightly smaller on mobile */
    }
}

/* =====================================================
   ENHANCED MESSAGE RESPONSIVENESS
===================================================== */

/* Base message styling with proper line breaks */
.complaint-msg,
.admin-response,
.accordion-body p,
.accordion-body div {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap; /* Preserves line breaks from textarea */
    max-width: 100%;
}

/* Specific message containers */
.complaint-msg {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.6;
    padding: 12px;
    background: var(--off-white);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Admin response styling */
.admin-response {
    margin-top: 15px;
    padding: 15px;
    background: var(--beige);
    border-radius: 12px;
    border-left: 4px solid var(--primary-brown);
    word-wrap: break-word;
    word-break: break-word;
}

.admin-response strong {
    color: var(--primary-brown);
    display: block;
    margin-bottom: 8px;
}

/* Accordion body content */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 20px;
    background: var(--off-white);
    word-wrap: break-word;
}

.accordion-item.active .accordion-body {
    max-height: 400px; /* Reduced for better scrolling */
    padding: 20px;
    overflow-y: auto; /* Enable scrolling for very long messages */
}

/* Scrollable message area for long content */
.accordion-body::-webkit-scrollbar {
    width: 6px;
}

.accordion-body::-webkit-scrollbar-track {
    background: var(--off-white);
    border-radius: 3px;
}

.accordion-body::-webkit-scrollbar-thumb {
    background: var(--accent-brown);
    border-radius: 3px;
}

/* Form textarea adjustments for better input */
.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    word-break: break-word;
}

/* For extremely long words/URLs */
.message-content {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Enhanced responsive handling */
@media (max-width: 768px) {
    .complaint-msg,
    .admin-response {
        padding: 10px;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .accordion-body {
        padding: 0 15px;
    }
    
    .accordion-item.active .accordion-body {
        max-height: 300px;
        padding: 15px;
    }
    
    /* Better line breaking on mobile */
    .complaint-msg,
    .admin-response {
        word-break: break-word;
        hyphens: auto;
    }
}

@media (max-width: 480px) {
    .complaint-msg,
    .admin-response {
        font-size: 13px;
        padding: 8px;
    }
    
    .accordion-item.active .accordion-body {
        max-height: 250px;
    }
    
    /* Ensure long URLs break properly on small screens */
    .message-content {
        overflow-wrap: anywhere;
    }
}

/* For email/URLs in messages */
.message-content a {
    word-break: break-all;
    color: var(--primary-brown);
    text-decoration: underline;
}

/* Status badges responsive */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap; /* Keep badge text on one line */
}

@media (max-width: 576px) {
    .status-badge {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* Contact info card message history */
.contact-info-card .accordion-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 20px;
}

/* Message metadata */
.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-dark);
    opacity: 0.8;
}

.message-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Print styles for messages */
@media print {
    .complaint-msg,
    .admin-response {
        white-space: pre-wrap;
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .complaint-msg,
    .admin-response {
        border: 2px solid currentColor;
    }
}

/* Dark mode adjustments (if you add dark mode later) */
@media (prefers-color-scheme: dark) {
    .complaint-msg {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .admin-response {
        background: rgba(150, 114, 89, 0.1);
    }
}

/* Animation for new messages */
@keyframes highlightNew {
    0% { background-color: rgba(150, 114, 89, 0.2); }
    100% { background-color: transparent; }
}

.new-message {
    animation: highlightNew 2s ease;
}

/* Utility class for extremely long content */
.long-content {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Typography improvements for readability */
.message-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    letter-spacing: 0.01em;
}

/* Ensure form validation messages wrap */
.form-group .error-message {
    word-wrap: break-word;
    white-space: normal;
    margin-top: 5px;
    font-size: 14px;
    color: var(--error);
}

/* Character counter for textarea */
.char-counter {
    font-size: 12px;
    text-align: right;
    margin-top: 5px;
    color: var(--text-dark);
    opacity: 0.7;
}

.char-counter.near-limit {
    color: var(--warning);
}

.char-counter.over-limit {
    color: var(--error);
}