/* ================================================
   COMPONENTS.CSS - UI Components & Cards
   ================================================ */

/* ============================================
   ITEM CARDS - Fixed Image Embedding
   ============================================ */

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
    padding: 0;
}

.item-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Image Wrapper - Fixed Aspect Ratio Container */
.item-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: #E0E0E0;
    overflow: hidden;
}

/* NOTE: .item-image rules removed — in the current item-grid markup
   .item-image is the wrapper div, styled in site.css */

/* Badge - Positioned on Top of Image */
.item-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    background: rgba(76, 175, 80, 0.95);
    color: #FFFFFF;
    backdrop-filter: blur(4px);
}

.item-badge.premium {
    background: rgba(255, 152, 0, 0.95);
}

.item-badge.new {
    background: rgba(33, 150, 243, 0.95);
}

.item-badge.trending {
    background: rgba(233, 30, 99, 0.95);
}

/* Content - Below Image */
.item-content {
    position: relative;
    padding: 16px;
    background: #FFFFFF;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #212121;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.item-title a:hover {
    color: #4CAF50;
}

.item-description {
    font-size: 0.9rem;
    color: #757575;
    margin: 0 0 12px 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #9E9E9E;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #F5F5F5;
}

.item-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-stat i {
    font-size: 0.9rem;
    color: #BDBDBD;
}

/* ============================================
   CATEGORY CARDS
   ============================================ */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.category-card {
    position: relative;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: #FFFFFF;
    padding: 32px 24px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.category-card:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.category-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.category-count {
    font-size: 0.9rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: #4CAF50;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #45A049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #F5F5F5;
    color: #212121;
}

.btn-secondary:hover {
    background: #EEEEEE;
}

.btn-download {
    background: linear-gradient(135deg, #4CAF50, #45A049);
}

.btn-like {
    background: #FAFAFA;
    border: 2px solid #E0E0E0;
}

.btn-like:hover {
    background: #FFE0E0;
    border-color: #FF5252;
    color: #FF5252;
}

.btn-like.liked {
    background: #FF5252;
    color: #FFFFFF;
    border-color: #FF5252;
}

.btn-share {
    background: #2196F3;
    color: #FFFFFF;
}

.btn-share:hover {
    background: #1976D2;
}

/* ============================================
   TAGS
   ============================================ */

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tag-item {
    display: inline-block;
    padding: 6px 12px;
    background: #F5F5F5;
    color: #616161;
    border-radius: 16px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: #4CAF50;
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #FFFFFF;
    color: #616161;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: #4CAF50;
    color: #FFFFFF;
    border-color: #4CAF50;
}

.page-link.active {
    background: #4CAF50;
    color: #FFFFFF;
    border-color: #4CAF50;
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid #E0E0E0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #4CAF50;
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #45A049;
    transform: translateY(-50%) scale(1.05);
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    background: #F5F5F5;
    padding: 16px 0;
    margin-bottom: 30px;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #616161;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #4CAF50;
}

.breadcrumb i {
    color: #BDBDBD;
    font-size: 0.7rem;
}

.breadcrumb span {
    color: #212121;
    font-weight: 500;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #FFFFFF;
    padding: 32px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.modal-content .close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9E9E9E;
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: #212121;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #F5F5F5;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid #4CAF50;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #F44336;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid #2196F3;
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border-left: 4px solid #FF9800;
}
