/* Resources Specific Styles - Aligning with styles.css */

/* Layout */
.resources-container {
    max-width: 1400px; /* Wider for grid */
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px; /* Below header */
    height: calc(100vh - 120px);
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.main-content {
    flex-grow: 1;
}

/* Sidebar Navigation */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: #888;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.category-item span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.category-item:hover, .category-item.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    transform: translateX(5px);
}

.category-count {
    background: #222;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
    flex-shrink: 0;
    min-width: 24px;
    text-align: center;
    transition: all 0.2s;
}

.category-item:hover .category-count, .category-item.active .category-count {
    color: #000;
    background: var(--accent-color);
}

/* Active Filters Area */
#active-filters {
    margin-bottom: 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 32px; /* Prevent layout jump */
}

#active-filters .tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    color: var(--accent-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

#active-filters .tag:hover {
    background: var(--accent-color);
    color: #000;
}

#active-filters .tag i {
    margin-left: 8px;
    font-size: 0.8em;
}

/* Header & Controls */
.page-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    flex: 1 1 400px;
}

.page-title h1 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
}

.page-title p {
    color: #888;
    margin: 0;
    font-family: monospace;
    font-size: 0.9rem;
    padding-left: 19px; /* Align with text */
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border: 1px solid #222;
    border-radius: 4px;
}

.search-box {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.search-box input {
    width: 100%;
    background: #050505;
    border: 1px solid #333;
    padding: 10px 15px 10px 40px;
    border-radius: 2px; /* Sharper corners */
    color: #ccc;
    outline: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-family: Consolas, monospace;
}

.search-box input:focus {
    border-color: var(--accent-color);
    background: #000;
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.search-box input:focus + i {
    color: var(--accent-color);
}

.sort-select {
    background: #050505;
    color: #ccc;
    border: 1px solid #333;
    padding: 10px 15px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: Consolas, monospace;
    min-width: 150px;
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23888888%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px auto;
}

.sort-select:hover {
    border-color: #555;
    color: #fff;
}

.sort-select:focus {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.resource-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards stretch to fill grid row for aligned buttons */
    position: relative;
    overflow: hidden; /* So full-width footer button respects rounded corners */
}

.resource-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.1);
    transform: translateY(-3px);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.card-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.3;
}

.card-title span {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-top: 4px;
}

.card-desc {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.5;
    max-height: 4.2em; /* ~3 lines */
    overflow: hidden;
    position: relative;
}

.card-desc::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.4em;
    background: linear-gradient(to bottom, rgba(15, 18, 22, 0), var(--card-bg));
    pointer-events: none;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: #1a1a1a;
    color: #888;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.card-action {
    margin-top: auto;
    margin-left: -20px; /* Pull button to card edges horizontally */
    margin-right: -20px;
}

.btn-visit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #000;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-visit:hover {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.fav-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
    padding: 5px;
}

.fav-btn:hover, .fav-btn.active {
    color: var(--accent-color);
}

/* Stats Styling */
.stats {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.stats h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.stat-val {
    color: var(--accent-color);
    font-family: monospace;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .resources-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        max-height: 200px; /* Collapsed view or use details/summary */
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        width: 100%;
    }
    .controls {
        flex-direction: column;
    }
}
