:root {
    --dark: #1c1c1c;
    --muted: #8a8a8a;
    --border: #ececec;
}

.btn:focus {
    box-shadow: none;
}

.media-header {
    text-align: center;
    padding: 150px 15px 25px;
}

.media-header h1 {
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 10px;
}

.media-header p {
    color: var(--muted);
    font-size: 1rem;
}

.media-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.media-filters .btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.85rem;
    color: var(--dark);
    background: #fff;
}

.media-filters .btn:hover {
    border-color: var(--company-color);
    color: var(--company-color);
}

.media-filters .btn.active {
    background: var(--company-color);
    border-color: var(--company-color);
    color: #fff;
}

.media-card {
    overflow: hidden;
    margin-bottom: 30px;
    text-decoration: none;
    color: var(--dark);
    display: block;
    border: 1px solid #efefef;
    border-radius: 7px;
    transition: .5s;
}

.media-card .thumb {
    position: relative;
    width: 100%;
    padding-top: 80%;
    overflow: hidden;
    background: #fff;
}

.media-card .thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .35s ease;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .08);
}

.thumb .badge-count {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.thumb .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.media-card .info {
    padding: 14px;
    text-align: right;
}

.media-card .info .category {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.media-card .info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.media-card .info .date {
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- مودال گالری تصویر ---------- */
#imageGalleryModal .modal-dialog {
    max-width: 800px;
}

#imageGalleryModal .modal-content {
    /*background: #000;*/
    border: none;
}

#imageGalleryModal .modal-body {
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

#imageGalleryModal .gallery-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

#imageGalleryModal .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(47, 47, 47, 0.15);
    border: none;
    color: #000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#imageGalleryModal .gallery-nav:hover {
    background: rgba(58, 58, 58, 0.3);
    color: var(--company-color);
}

#imageGalleryModal .gallery-nav:focus {
    outline: none;
}

#imageGalleryModal .gallery-prev {
    right: 10px;
}

#imageGalleryModal .gallery-next {
    left: 10px;
}

#imageGalleryModal .gallery-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .6);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
}

#imageGalleryModal .close {
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 5;
    color: #000;
    opacity: .9;
    font-size: 2rem;
    text-shadow: none;
}

/* ---------- مودال پلیر ویدیو ---------- */
#videoModal .modal-dialog {
    max-width: 800px;
}

#videoModal .modal-content {
    background: #fff;
    border: none;
}

#videoModal .modal-body {
    padding: 0;
}

#videoModal video {
    width: 100%;
    max-height: 80vh;
    display: block;
}

#videoModal .close {
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 5;
    color: #fff;
    opacity: .9;
    font-size: 2rem;
    text-shadow: none;
}

/* ---------- نوار ابزار (مرتب‌سازی و تعداد) ---------- */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.catalog-toolbar .count {
    color: var(--dark);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- کارت کاتالوگ ---------- */
.catalog-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.catalog-card .cover {
    width: 100%;
    /*aspect-ratio: 3/4;*/
    /*border-radius: 8px;*/
    overflow: hidden;
    margin-bottom: 16px;
    /*background: #111;*/
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card .cover img {
    width: 60%;
    height: 100%;
    object-fit: contain;
}

.catalog-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.catalog-card .version {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.catalog-card .file-meta {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.catalog-card .file-meta i {
    color: #dc3545;
}

.catalog-card .btn-download {
    background: var(--company-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    margin-top: auto;
}
