/* directory.css - Complete file with all enhancements */
.imt-directory-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
    font-family: "Poppins", Sans-serif;
}

.imt-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(470px, 1fr));
    gap: 20px;
    margin-top: 20px;
    min-height: 200px;
}

/* Exact box design from image */
.imt-directory-item {
    background: #ffffff;
    padding: 10px 15px 15px 15px;
    position: relative;
    box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
    border: solid 2px #9A9A9A;
    border-radius: 10px;
}

.imt-directory-item:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    border-color: #ccc;
}

.detail-row.detail-row-1 {
    justify-content: space-between;
}

/* Company name styling */
.company-name {
    margin: 0 0 15px 0;
    padding-right: 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    width: 100%;
    color: #FF7109 !important;
    font-family: poppins;
}

/* Key person/designation line */
.company-subtitle {
    margin: 0 0 8px 0;
    padding: 3px 0px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 2px solid #f0f0f0;
    width: 100%;
    background-color: #FF7109;
    text-align: center;
    font-family: poppins;
}

/* Detail rows */
.detail-row {
    margin-bottom: 0px;
    display: flex;
    align-items: baseline;
    font-size: 14px;
    line-height: 1.5;
    color: #000;
}

.detail-label {
    font-weight: 700;
    color: #FF7109;
    min-width: 65px;
    margin-right: 5px;
}

.detail-value {
    color: #000;
}

/* Products line */
.products-row {
    margin: 0px 0 0px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #000;
}

.products-label {
    font-weight: 700;
    color: #FF7109;
    min-width: 65px;
    margin-right: 5px;
}

/* Contact section - 2 column layout */
.contact-row {
    margin: 7px 0 0px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 20px;
}

/* Left and right columns */
.contact-left,
.contact-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    min-width: 0; /* Allow text truncation */
    width: 100%;
}



.contact-item.empty:hover {
    opacity: 0.5;
}

.contact-item .emoji {
    font-size: 16px;
    line-height: 1;
    min-width: 20px;
    flex-shrink: 0;
}

.contact-item span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emoji i {
    color: #FF7109;
}

/* Divider line */
.divider {
    margin: 12px 0 10px 0;
    border-top: 2px solid #FF7109;
    width: 100%;
}

/* Address sections */
.address-section {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.5;
    color: #000;
}

.address-section:last-child {
    margin-bottom: 0;
}

.address-label {
    font-weight: 700;
    color: #FF7109;
    min-width: 65px;
    margin-right: 5px;
}

.address-text {
    color: #000;
    display: inline;
}

/* FIMTIA badge */
.fimtia-badge {
    position: absolute;
    top: 0px;
    right: 20px;
    background: #FF7109;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    padding: 4px 8px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    word-break: break-word;
    width: 80px;
    text-align: center;
    line-height: 15px;
}

/* Search section styling */
.imt-search-section {
    background: #FF7109;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.imt-search-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff !important;
    font-size: 24px;
    font-weight: 600;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 6px;
}

.search-row {
    width: 32%;
}

.search-row.full-width {
    width: 100%;
}

.search-row input[type="text"],
.search-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.search-row input[type="text"]:focus,
.search-row select:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.search-row.checkbox-row {
    display: flex;
    align-items: center;
}

.search-row.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.search-row.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #FF7109;
}

/* Alphabet filter */
.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 4px;
}

.filter-label {
    color: white;
    font-weight: 500;
    margin-right: 10px;
    font-size: 14px;
}

.alphabet-btn {
    min-width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.1);
    color: white !important;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 10px;
    border: 1px solid #FF7109 !important;
}

.alphabet-btn:hover {
    background: #FF7109 !important;
    transform: scale(1.05);
}

.alphabet-btn.active {
    background: #FF7109;
    color: #fff !important;
    border-color: white;
    font-weight: 600;
}

#imt-search-btn,
#imt-reset-btn {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#imt-search-btn {
    background: #fff;
    color: #333;
    margin-right: 10px;
}

#imt-search-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#imt-reset-btn {
    background: rgba(255,255,255,0.2);
    color: white;
}

#imt-reset-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Pagination styles */
.imt-pagination {
    margin: 30px 0;
    text-align: center;
}

.pagination-container {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.pagination-btn:hover {
    background: #FF7109;
    color: white;
    border-color: #FF7109;
    transform: scale(1.05);
}

.pagination-btn.active {
    background: #FF7109;
    color: white;
    border-color: #FF7109;
    font-weight: 600;
}

.pagination-btn.prev,
.pagination-btn.next {
    min-width: 80px;
}

.pagination-dots {
    padding: 0 5px;
    color: #666;
    font-weight: 500;
}

/* Loading and message styles */
.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    border: 1px dashed #FF7109;
}

.loading-message::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
    80%, 100% { content: ""; }
}

/* No results styling */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 4px;
    color: #666;
    font-size: 16px;
    border: 1px dashed #FF7109;
    margin: 20px 0;
}

.no-results::before {
    content: "🔍 ";
    font-size: 20px;
}

/* Notifications */
.imt-notification {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.imt-notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.imt-notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.imt-notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Search loader */
#search-loader {
    margin: 20px 0;
}

#search-loader img {
    max-width: 50px;
    height: auto;
}

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

/* Responsive Design */
@media (max-width: 992px) {
    .search-row {
        width: 48%;
    }
}

@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-row {
        width: 100%;
    }
    
    .imt-directory-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-row {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 8px;
    }
    
    .contact-left,
    .contact-right {
        width: 100%;
    }
    
    .contact-item {
        width: 100%;
    }
    
    .fimtia-badge {
        position: static;
        margin-bottom: 10px;
        display: inline-block;
        width: auto;
        border-radius: 4px;
    }
    
    .alphabet-filter {
        justify-content: center;
    }
    
    .pagination-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-btn {
        min-width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .pagination-btn.prev,
    .pagination-btn.next {
        min-width: 70px;
    }
    
    .imt-search-section {
        padding: 20px;
    }
    
    .imt-search-section h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .alphabet-btn {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .filter-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .pagination-btn {
        min-width: 30px;
        height: 30px;
    }
    
    .pagination-btn.prev,
    .pagination-btn.next {
        min-width: 60px;
        font-size: 11px;
    }
}

/* Print styles */
@media print {
    .imt-search-section,
    .imt-pagination,
    .fimtia-badge {
        display: none;
    }
    
    .imt-directory-item {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}