/* ============================================
   Accounting Post List Page Styles
   Color Theme: Matching website colors (#50bfda, #e21111)
   Layout: Sidebar Filter + Content
   ============================================ */

/* Page Container */
.accounting-directory-page {
    position: relative;
    display: block;
    padding: 40px 0 80px;
    background: #f8fbfc;
    min-height: 100vh;
}

/* Two Column Layout */
.directory-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    position: relative;
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ffffff;
    color: #50bfda;
    border: 2px solid #50bfda;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

.mobile-filter-toggle:hover {
    background: #50bfda;
    color: #ffffff;
}

/* Filter Overlay */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Sidebar Header (Mobile Only) */
.sidebar-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    margin: -20px -20px 20px -20px;
    background: #50bfda;
    border-radius: 0;
}

.sidebar-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    font-family: "Mitr", sans-serif;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.sidebar-close:hover {
    opacity: 0.7;
}

/* Left Sidebar */
.directory-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #50bfda;
    margin: 0 0 15px;
    font-family: "Mitr", sans-serif;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-item {
    margin-bottom: 5px;
}

.filter-item a {
    display: block;
    padding: 8px 12px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-family: "Mitr", sans-serif;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.filter-item a:hover {
    background: #f0fafc;
    color: #50bfda;
}

.filter-item.active a {
    color: #e21111;
    font-weight: 500;
    background: transparent;
}

/* Sidebar Action Button */
.sidebar-action {
    margin-top: 20px;
}

.btn-post-new-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #50bfda 0%, #3da8c4 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-post-new-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(80, 191, 218, 0.35);
    color: #ffffff;
}

/* Right Content */
.directory-content {
    flex: 1;
    min-width: 0;
}

/* Results Header */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    font-size: 18px;
    font-weight: 500;
    color: #212529;
    margin: 0;
    font-family: "Mitr", sans-serif;
}

.results-count strong {
    color: #212529;
}

.results-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-post-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e21111 0%, #c41e3a 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(226, 17, 17, 0.2);
}

.btn-post-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226, 17, 17, 0.35);
    color: #ffffff;
}

.btn-post-new-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #50bfda 0%, #3da8c4 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-post-new-inline .icon-plus {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.btn-post-new-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(80, 191, 218, 0.35);
    color: #ffffff;
}

.sort-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select label {
    font-size: 14px;
    color: #6c757d;
    font-family: "Mitr", sans-serif;
    margin: 0;
    white-space: nowrap;
}

.sort-select .form-select {
    appearance: none;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Mitr", sans-serif;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.sort-select .form-select:focus {
    outline: none;
    border-color: #50bfda;
}

/* Directory List */
.directory-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Directory Item */
.directory-item {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.directory-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #50bfda;
}

.post-date {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 13px;
    color: #6c757d;
    font-family: "Mitr", sans-serif;
}

.directory-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.directory-item-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a5276;
    margin: 0;
    font-family: "Mitr", sans-serif;
    line-height: 1.3;
}

.directory-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.directory-item-name a:hover {
    color: #50bfda;
}

.directory-badges {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.badge-new {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
}

/* Type Badges */
.directory-item-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    font-family: "Mitr", sans-serif;
    border: 1px solid #e2e8f0;
}

/* Description */
.directory-item-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 15px;
    font-family: "Mitr", sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta Information */
.directory-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.meta-location,
.meta-date {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    font-family: "Mitr", sans-serif;
}

.meta-location i,
.meta-date i {
    color: #50bfda;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Contact Information */
.directory-item-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    font-family: "Mitr", sans-serif;
}

.contact-item.phone i {
    color: #10b981;
}

.contact-item.email i {
    color: #3b82f6;
}

.contact-item.line i {
    color: #00c300;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.no-results i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px;
    font-family: "Mitr", sans-serif;
}

.no-results p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    font-family: "Mitr", sans-serif;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #50bfda;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-family: "Mitr", sans-serif;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
}

.pagination {
    margin: 0;
}

.pagination .page-link {
    color: #50bfda;
    border-color: #e9ecef;
    font-family: "Mitr", sans-serif;
}

.pagination .page-item.active .page-link {
    background-color: #50bfda;
    border-color: #50bfda;
}

.load-status {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-family: "Mitr", sans-serif;
}

/* Responsive Styles */
@media (max-width: 991px) {
    /* Show mobile filter toggle button */
    .mobile-filter-toggle {
        display: flex;
    }
    
    /* Show filter overlay when active */
    .filter-overlay {
        display: block;
    }
    
    /* Hide sidebar by default, show as slide-in panel */
    .directory-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 9999;
        background: #ffffff;
        padding: 20px;
        overflow-y: auto;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
        border-radius: 0;
    }
    
    .directory-sidebar.active {
        left: 0;
    }
    
    /* Show sidebar header on mobile */
    .sidebar-header {
        display: flex;
    }
    
    .sidebar-section {
        margin-bottom: 15px;
    }
    
    .sidebar-action {
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid #e9ecef;
    }
    
    .btn-post-new-sidebar {
        width: 100%;
    }
    
    .directory-item-header {
        flex-direction: column;
    }
    
    /* Adjust content area */
    .directory-content {
        width: 100%;
    }
    
    /* Add padding at bottom for fixed filter button */
    .pagination-wrapper {
        padding-bottom: 70px;
    }
}

@media (max-width: 767px) {
    .accounting-directory-page {
        padding: 30px 0 60px;
    }
    
    .sidebar-section {
        min-width: 100%;
    }
    
    .results-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .results-header-right {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-post-new {
        width: 100%;
        justify-content: center;
    }
    
    .sort-select {
        width: auto;
        justify-content: flex-end;
    }
    
    .sort-select .form-select {
        flex: 1;
    }
    
    .directory-item {
        padding: 20px;
    }
    
    .directory-item-name {
        font-size: 16px;
    }
    
    .directory-item-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .directory-item-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar-section {
        padding: 15px;
    }
    
    .sidebar-title {
        font-size: 14px;
    }
    
    .filter-item a {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .directory-item-description {
        font-size: 13px;
    }
    
    .contact-link {
        font-size: 13px;
    }
    
    .type-badge {
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* Delete Text Link */
.btn-delete-text {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    font-family: "Mitr", sans-serif;
    transition: all 0.3s ease;
}

.btn-delete-text:hover {
    color: #dc3545;
}

/* Delete Modal */
.delete-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.delete-modal-overlay.active {
    display: flex;
}

.delete-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delete-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.delete-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #dc3545;
    margin: 0;
    font-family: "Mitr", sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.delete-modal-close:hover {
    color: #dc3545;
}

.delete-modal-body {
    padding: 20px;
}

.delete-modal-body p {
    font-size: 14px;
    color: #495057;
    margin: 0 0 20px;
    font-family: "Mitr", sans-serif;
}

.delete-modal-body .form-group {
    margin-bottom: 0;
}

.delete-modal-body label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 8px;
    font-family: "Mitr", sans-serif;
}

.delete-modal-body .form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: "Mitr", sans-serif;
    transition: all 0.3s ease;
}

.delete-modal-body .form-input:focus {
    outline: none;
    border-color: #50bfda;
}

.delete-modal-body .form-error {
    display: none;
    font-size: 13px;
    color: #dc3545;
    margin-top: 8px;
    font-family: "Mitr", sans-serif;
}

.delete-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    justify-content: flex-end;
}

.delete-modal-footer .btn-cancel {
    padding: 10px 20px;
    background: #ffffff;
    color: #6c757d;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-modal-footer .btn-cancel:hover {
    background: #f8f9fa;
}

.delete-modal-footer .btn-confirm-delete {
    padding: 10px 20px;
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: "Mitr", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-modal-footer .btn-confirm-delete:hover {
    background: #c82333;
}

.delete-modal-footer .btn-confirm-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.contact-restriction-msg {
    font-size: 13px;
    color: #ef4444;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Mitr", sans-serif;
}

.contact-restriction-msg i {
    font-size: 12px;
}

/* Expired Post Styles */
.expired-post {
    background: #fcfcfc;
    border-color: #eeeeee;
    position: relative;
    overflow: hidden;
}

.expired-post .directory-item-name,
.expired-post .directory-item-description, 
.expired-post .meta-location {
    opacity: 0.7;
}

/* Ribbon Container and Style */
.ribbon-expired {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 150px;
    height: 150px;
    overflow: hidden;
    z-index: 10;
    pointer-events: none;
}

.ribbon-expired span {
    position: absolute;
    display: block;
    width: 225px;
    padding: 8px 0;
    background-color: #ffc107;
    box-shadow: 0 5px 10px rgba(0,0,0,.1);
    color: #333;
    font-family: "Mitr", sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    right: -55px;
    top: 45px;
    transform: rotate(45deg);
    border: 1px solid #e0a800;
}

.contact-restriction-msg.expired-msg {
    color: #e21111;
    background-color: #fff5f5;
    border: 1px solid #ffc9c9;
    width: 100%;
}
