#main-view {
    min-height: calc(100vh - var(--navbar-height) - 100px);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.8rem;
}

.item-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow);
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 224, 255, 0.5);
    z-index: 10;
}

.item-card .badge {
    position: absolute;
    top: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-card .top-badge {
    left: 1rem;
    background: var(--warning);
    color: var(--primary);
}

.item-card .available-badge {
    right: 1rem;
    background: var(--success);
    color: var(--primary);
}

.item-poster {
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 150%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.item-card:hover .item-poster {
    transform: scale(1.08);
}

.item-poster img {
    display: block;
    width: 100%;
    height: auto;
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.9) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.item-card:hover .item-overlay {
    opacity: 1;
}

.item-info {
    padding: 1.2rem;
    position: relative;
    z-index: 2;
    margin-top: auto;
    background: var(--card-bg);
    transition: var(--transition);
}

.item-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.item-card:hover .item-title {
    color: var(--accent);
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.item-rating {
    font-weight: 600;
}

.item-rating.rating-good {
    color: var(--success);
}

.item-rating.rating-ok {
    color: var(--warning);
}

.item-rating.rating-bad {
    color: var(--danger);
}

.item-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.item-card:hover .item-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.action-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.action-btn:hover:not(:disabled) {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.1);
    border-color: transparent;
    box-shadow: 0 6px 15px rgba(0, 224, 255, 0.3);
}

.action-btn.favorites-btn.active {
    background: var(--danger);
    color: white;
}

.action-btn.favorites-btn.active:hover {
    background: #c62828;
}

.action-btn.disabled-btn {
    cursor: not-allowed;
    opacity: 0.6;
    background: rgba(80, 80, 80, 0.3);
}

.action-btn.disabled-btn:hover {
    transform: none;
    background: rgba(80, 80, 80, 0.3);
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}


.recommendations-section {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    margin-top: 4rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass);
    border: 1px dashed var(--glass-border);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.empty-state i.fas,
.empty-state i.far {
    font-size: 3.5rem;
    color: var(--accent);
    opacity: 0.6;
    margin-bottom: 1.5rem;
    display: block;
}

.empty-state p.lead {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.empty-state p.text-muted {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.empty-state .btn {
    margin-top: 1rem;
}

.history-section {
    margin-top: 4rem;
}

#history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.2rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-item:hover {
    background: rgba(0, 224, 255, 0.08);
    transform: translateX(8px);
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.history-poster {
    width: 55px;
    height: 82px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.history-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-remove-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.history-item:hover .history-remove-btn {
    opacity: 1;
}

.history-remove-btn:hover {
    background-color: var(--danger);
    color: white !important;
}

@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 576px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
        gap: 1rem;
    }
}