body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
    background-color: #f8f9fa;
}

*, *:before, *:after {
    box-sizing: inherit;
}

.hero-section {
    height: 60vh;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    background-image: url('../image/down.png');
    background-size: cover;
    background-position: center;
    color: white;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hero-content h1 {
    font-size: 4rem;
    margin: 0;
    font-weight: 600;
}

.hero-content p {
    font-size: 1.25rem;
    margin-top: 0.5rem;
    font-weight: 300;
    max-width: 600px;
}

.materials-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    font-size: 2.2rem;
    color: #333;
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 600;
}

.category-title {
    margin-top: 2rem;
    font-size: 1.5rem;
    color: #555;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background-color: transparent;
    padding: 0.5rem;
    border-radius: 12px;
}

.filter-bar input[type="text"],
.filter-bar select {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 120px;
}

.filter-bar input[type="text"] {
    flex: 3 1 520px;
}

.filter-bar select {
    flex: 0 0 160px;
}

.filter-bar .search-btn {
    padding: 0.75rem 2rem;
    border: none;
    background-color: rgb(12, 102, 0);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-bar .search-btn:hover {
    background-color: rgb(16, 136, 0);
}

.files-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.material-item {
    display: flex;
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.pdf-icon {
    flex: 0 0 80px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
}

.pdf-icon img {
    width: 48px;
    height: 48px;
}

.material-content {
    flex: 1;
    padding: 20px 0;
}

.material-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    display: flex;
    align-items: center;
}

.hot-tag {
    display: inline-block;
    background-color: rgb(15, 129, 0);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: bold;
}

.material-specs {
    list-style-type: none;
    padding: 0;
    margin: 0;
    color: #666;
}

.material-specs li {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.material-rating {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
}

.stars {
    color: #ffc107;
    font-size: 1.1rem;
    letter-spacing: -2px;
}

.votes {
    color: #777;
    font-size: 0.9rem;
    margin-top: 5px;
}

.material-download {
    flex: 0 0 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.download-btn {
    background-color: rgb(17, 146, 0);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #7a1515;
}

.material-preview {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
}

.preview-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.preview-image-container {
    position: relative;
    border: 1px solid #ddd;
    cursor: pointer;
    overflow: hidden;
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    transition: transform 0.2s;
}

.preview-image-container:hover {
    transform: scale(1.03);
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.info-table-container {
    margin-top: 1px;
    margin-bottom: 2rem;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-header {
    background-color: #f0f0f0;
    padding: 10px 15px;
    font-weight: 600;
    color: #555;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid #eee;
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 10px 15px;
    color: #666;
}

.info-table td:first-child {
    font-weight: 500;
    width: 30%;
}

.pdf-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.pdf-viewer-container {
    width: 90%;
    height: 90%;
    background-color: #fff;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.pdf-viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #981b1b;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    font-size: 1.2rem;
}

.pdf-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.image-viewer-container {
    position: relative;
    width: 90%;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.image-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    background-color: #981b1b;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background-color 0.3s;
}

.image-viewer-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.image-viewer-prev {
    left: 20px;
}

.image-viewer-next {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1rem;
}

@media (max-width: 992px) {
    .material-item {
        flex-wrap: wrap;
    }
    .pdf-icon {
        flex: 0 0 60px;
    }
    .material-content {
        flex: 1 1 calc(100% - 60px);
    }
    .material-rating {
        flex: 1 1 50%;
        align-items: flex-start;
        padding-left: 80px;
    }
    .material-download {
        flex: 1 1 50%;
        justify-content: flex-end;
    }
    .material-preview {
        flex: 0 0 100%;
        padding: 15px;
    }
    .preview-images {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .materials-container {
        padding: 3rem 1rem;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar input[type="text"],
    .filter-bar select,
    .filter-bar .search-btn {
        width: 100%;
        flex: 1 1 100%;
    }
    .material-rating, 
    .material-download {
        flex: 1 1 100%;
        justify-content: center;
        align-items: center;
        padding: 10px 20px;
    }
    .material-rating {
        padding-top: 0;
    }
    .preview-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
    .material-title {
        font-size: 1.1rem;
    }
    .info-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}