.resource-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dark .resource-card {
    border-color: rgba(255, 255, 255, 0.1);
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.dark .resource-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.resource-type-icon {
    display: inline-flex;
    padding: 8px;
    border-radius: 8px;
    margin-right: 12px;
    color: rgb(59, 130, 246);
    background-color: rgba(59, 130, 246, 0.1);
}

.dark .resource-type-icon {
    color: rgb(147, 197, 253);
    background-color: rgba(30, 58, 138, 0.5);
}

.filter-btn {
	display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 500;
    height: 40px;
}

.filter-btn.active {
	background-color: rgb(219 234 254) !important;
	color: rgb(30 64 175) !important;
}

.dark .filter-btn.active {
	background-color: rgb(30 58 138) !important;
	color: rgb(191 219 254) !important;
}

.filter-btn.has-icon i {
    transition: transform 0.2s ease;
}

.filter-btn.has-icon.active i.fa-chevron-down {
	transform: rotate(180deg);
}

.filter-dropdown {
    position: relative;
    display: inline-block;
}

.submenu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    border-radius: 8px;
    z-index: 50;
    overflow: visible;
    max-height: 0;
    min-width: 280px;
    width: max-content;
	word-wrap: break-word;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: rgb(255, 255, 255);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

.dark .submenu {
    background-color: rgb(31, 41, 55);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.submenu.visible {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.modal-content {
    position: relative;
    border-radius: 12px;
    max-width: 90%;
    width: 700px;
    overflow: visible;
}

#closeModal {
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header {
    display: flex;
    flex-direction: column;
    padding-bottom: 16px;
}

.modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.modal-resource-type {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-resource-type-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 16px;
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .modal-resource-type-badge {
    background-color: rgba(255, 255, 255, 0.1);
}

.detail-item {
    margin-bottom: 24px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 16px;
}

.category-tag.primary {
    background-color: rgb(219, 234, 254);
    color: rgb(30, 64, 175);
}

.dark .category-tag.primary {
    background-color: rgb(30, 58, 138);
    color: rgb(191, 219, 254);
}

.category-tag.secondary {
    background-color: rgb(243, 244, 246);
    color: rgb(55, 65, 81);
}

.dark .category-tag.secondary {
    background-color: rgb(55, 65, 81);
    color: rgb(209, 213, 219);
}

#scrollToTop {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

#scrollToTop:hover {
    transform: translateY(-3px);
}

.scroll-to-top {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.suggest-material-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    display: inline-flex;
}

.sub-btn {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    white-space: normal !important;
    line-height: 1.4;
    min-height: 44px;
    align-items: center;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

.sub-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: rgb(59, 130, 246);
}

.dark .sub-btn:hover {
    background-color: rgba(96, 165, 250, 0.15);
    border-left-color: rgb(96, 165, 250);
}

.sub-btn.active {
    background-color: rgb(219, 234, 254) !important;
    color: rgb(30, 64, 175) !important;
    border-left-color: rgb(59, 130, 246);
}

.dark .sub-btn.active {
    background-color: rgb(30, 58, 138) !important;
    color: rgb(191, 219, 254) !important;
    border-left-color: rgb(96, 165, 250);
}

.favorite-btn,
.card-favorite-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    transition: all 0.2s ease;
    z-index: 5;
    cursor: pointer;
}

.favorite-btn:not(.active),
.card-favorite-btn:not(.active) {
    color: #9ca3af;
    background-color: #f3f4f6;
}

.dark .favorite-btn:not(.active),
.dark .card-favorite-btn:not(.active) {
    color: #9ca3af;
    background-color: #374151;
}

.favorite-btn.active,
.card-favorite-btn.active {
    color: #f59e0b;
    background-color: #fff9ed;
}

.dark .favorite-btn.active,
.dark .card-favorite-btn.active {
    color: #f59e0b;
    background-color: #3f3926;
}

.resource-card.favorite {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    background-color: #fffbf0;
}

.dark .resource-card.favorite {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    background-color: rgba(245, 158, 11, 0.08);
}

.card-favorite-btn {
    top: 12px;
    right: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 5;
}

.card-favorite-btn i,
.favorite-btn i {
    transition: transform 0.3s ease, color 0.2s ease;
}

.card-favorite-btn.active i,
.favorite-btn.active i {
    transform: scale(1.1);
    color: #f59e0b !important;
}

.resource-card:hover .card-favorite-btn {
    opacity: 1;
    visibility: visible;
}

.resource-card:hover .card-favorite-btn.active {
    opacity: 1;
    visibility: visible;
}

.card-favorite-btn.active {
    opacity: 0;
    visibility: hidden;
}

.resource-card {
    position: relative;
}

.favorite-btn {
    top: 16px;
    right: 50px;
}

.favorite-indicator {
    display: inline-flex !important;
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #f59e0b;
    border-radius: 0 8px 0 8px;
    background-color: #fff9ed;
    z-index: 4;
}

.dark .favorite-indicator {
    background-color: rgba(245, 158, 11, 0.2);
}

.resource-card.favorite h3.text-xl {
    padding-right: 30px;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.burger-menu,
.header-buttons,
.scroll-to-top,
.notification,
.modal,
.menu-overlay {
    max-width: 100vw;
}

.menu-content {
    max-width: 90vw;
    width: 300px;
}

.menu-content.visible {
    transform: scale(1);
    opacity: 1;
}

#closeMenu {
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.favorite-btn {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeModal:hover, .favorite-btn:hover {
    transform: translate(50%, -50%) scale(1.1);
}

.favorite-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.remove-favorite {
    background-color: #fff9ed !important;
    color: #f59e0b !important;
}

.dark .remove-favorite {
    background-color: #3f3926 !important;
    color: #f59e0b !important;
}

#resourceModal {
    z-index: 1000 !important;
}

#closeFavoritesModal {
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeFavoritesModal:hover {
    transform: translate(50%, -50%) scale(1.1);
}

#favoritesModal {
    z-index: 1000;
}

@media (max-width: 768px) {
	#closeModal, .favorite-btn {
        width: 32px;
        height: 32px;
    }
    .menu-content {
        max-width: 90vw;
        width: 350px;
    }
    
    .menu-btn i {
        font-size: 2.2rem;
    }
    
    .menu-btn span {
        font-size: 1rem;
    }
	
	.suggest-material-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
    
    .btn-text {
        display: none;
    }
    
    .btn-icon {
        font-size: 16px;
    }	
	
    .filters-container {
		width: 100%;
		display: flex;
		flex-direction: column;
	}

    
    .filter-dropdown {
        position: relative;
    }
    
    .filter-toggle {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        margin-top: 16px;
        margin-bottom: 16px;
        padding: 12px 16px;
        border-radius: 8px;
        background-color: rgb(243, 244, 246);
        color: rgb(55, 65, 81);
        font-weight: 500;
    }
	
	#filters.hidden {
        display: none !important;
    }
    
    .dark .filter-toggle {
        background-color: rgb(55, 65, 81);
        color: rgb(209, 213, 219);
    }
	
	#searchInput {
		margin-bottom: 8px;
	}
    
    #filters {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
        padding-bottom: 12px;
		flex-wrap: wrap;
    }
	
    .filter-btn {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        padding: 12px 16px;
        height: auto;
        min-height: 48px;
		white-space: normal;
		overflow: visible;
		line-height: 1.3;
		word-break: break-word;
    }
  
	.filter-dropdown {
		position: relative;
	}
  
    .submenu {
        position: static;
        transform: none !important;
        min-width: auto !important;
        width: calc(100% - 24px) !important;
		max-width: calc(100% - 24px);
        margin: 0;
        padding: 0;
        border: none;
        border-left: 3px solid rgb(59, 130, 246);
        margin-left: 16px;
        margin-top: 4px;
        margin-bottom: 4px;
        background-color: transparent;
        box-shadow: none;
    }

    .dark .submenu {
        border-left-color: rgb(96, 165, 250);
    }
  
    .submenu.visible {
        border-radius: 0;
        box-shadow: none;
    }
  
    .sub-btn {
		width: 100%;
		text-align: left;
		padding: 10px 16px;
		white-space: normal !important;
		line-height: 1.4;
		min-height: 44px;
		display: flex;
		align-items: center;
		transition: all 0.2s ease;
		border-left: 3px solid transparent;
		font-size: 14px;
		word-break: break-word;
		hyphens: auto;
		white-space: normal;
		overflow-wrap: break-word;
	}
	
	.sub-btn.active {
		background-color: rgb(219, 234, 254) !important;
		color: rgb(30, 64, 175) !important;
		border-left-color: rgb(59, 130, 246);
	}
	
    .sub-btn:last-child {
        border-bottom: none;
    }	
}