/* ==========================================================================
   DIRECTORY PAGE SPECIFIC STYLES
   ========================================================================== */
.dir-header { margin-bottom: 30px; }
.dir-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.1;
    letter-spacing: -1px;
}
.dir-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Header Buttons */
.dir-header-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}
.btn-dir-primary {
    background: #fff;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-dir-primary:hover {
    background: #e0e0e0;
}
.btn-dir-tertiary {
    background: transparent;
    color: #aaa;
    border: 1px solid #333;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-dir-tertiary:hover {
    color: #fff;
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

/* Terminal Search Box */
.dir-terminal-search {
    display: flex;
    align-items: center;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    
}
.dir-terminal-search span {
    color: #888;
    margin-right: 10px;
    font-size: 1.1rem;
}
.dir-terminal-search input {
    background: transparent;
    border: none;
    color: #fff;
    
    font-size: 1rem;
    width: 100%;
    outline: none;
}
.dir-terminal-search input::placeholder { color: #555; }

/* Filter Pills */
.dir-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.dir-filter-pill {
    background: transparent;
    border: 1px solid #333;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-primary, sans-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dir-filter-pill:hover, .dir-filter-pill.active {
    border-color: #666;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Results Counter */
.dir-results-count {
    font-family: var(--font-primary, sans-serif);
    color: #aaa;
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 500;
}

/* Directory List Container */
.dir-list-container {
    border: 1px solid #222;
    border-radius: 8px;
    background: #0a0a0a;
}
.dir-item {
    display: grid;
    grid-template-columns: 2fr 100px auto;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid #222;
    transition: background 0.2s;
    text-decoration: none;
    position: relative;
    z-index: 1; 
}
.dir-item:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.dir-item:last-child { border-bottom: none; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }

/* Hover states */
.dir-item:hover { 
    background: rgba(255, 255, 255, 0.03); 
    z-index: 2; 
}
.dir-ext-icon { opacity: 0; transition: opacity 0.2s, stroke 0.2s; stroke: #888; }
.dir-item:hover .dir-ext-icon { opacity: 1; stroke: #fff; }

/* Item Left Side */
.dir-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.dir-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 900;
    flex-shrink: 0;
}
.dir-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.dir-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.dir-name {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: var(--font-primary, sans-serif);
    letter-spacing: 0.5px;
}
.dir-badge {
    background: transparent;
    color: #888;
    border: 1px solid #333;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    
    font-weight: bold;
    white-space: nowrap;
}

/* Visitor Stats Column */
.dir-item-stats {
    
    color: #aaa;
    text-align: right;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Item Right Side (Icons) */
.dir-item-right {
    display: flex;
    align-items: center;
    gap: 25px;
    justify-content: flex-end;
}

/* Custom Tooltip Logic */
.dir-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    width: 20px;
    height: 20px;
    position: relative;
    cursor: default;
}

.dir-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #111;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    font-size: 13px;
    
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,1);
    pointer-events: none;
}
.dir-icon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dir-icon.status-active { color: #888; }
.dir-icon.status-green { color: #2ed573; }
.dir-icon.status-red { color: #ff4757; }
.dir-icon.status-disabled { color: #333; opacity: 0.4; }

/* Pagination Controls */
.dir-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Fixes overlapping on small screens */
    gap: 10px;
    margin-top: 30px;
}
.page-btn {
    background: #111;
    color: #aaa;
    border: 1px solid #333;
    padding: 8px 14px;
    border-radius: 6px;
    
    cursor: pointer;
    transition: 0.2s;
}
.page-btn:hover { border-color: #666; color: #fff; }
.page-btn.active { background: #333; color: #fff; border-color: #555; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ==========================================================================
   MOBILE RESPONSIVE FIXES
   ========================================================================== */
@media (max-width: 768px) {
    /* Stack the header buttons to prevent squishing text */
    .dir-header-actions {
        flex-direction: column;
        gap: 10px;
    }
    .btn-dir-primary, .btn-dir-tertiary {
        width: 100%;
    }

    /* Adjust list item layout */
    .dir-item { 
        display: flex; 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 12px; 
    }
    .dir-item-stats { 
        text-align: left; 
    }
    .dir-item-right { 
        width: 100%; 
        justify-content: flex-start; 
        gap: 15px; /* Tighter gap between active icons */
    }
    
    /* HIDE the disabled icons entirely on mobile to save space */
    .dir-icon.status-disabled {
        display: none !important;
    }
}