/* Gift module styling aligned with SolutionGreen palette */

:root {
	--gift-bg: #2b2b35;
	--gift-panel: #30303c;
	--gift-border: #3c3c4a;
	--gift-muted: #8a8aa2;
	--gift-text: #ffffff;
	--gift-accent: radial-gradient(100% 100% at 50% 0, #4fea9f 0, #38644f 100%);
	--gift-accent-flat: #48c98f;
}

.gifts-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 15px;
}
#giftModalka .gift-info {
	pointer-events: auto;
}
.gifts-container .loader {
	grid-column: 1/-1;
	justify-self: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 3px solid #3c3c4a;
	border-top-color: #4fea9f;
	animation: spin 1s linear infinite;
}

.gift-item .gift-info {
  display: none;
}

.gift-item {
	    display: grid;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
    padding: 12px;
    background: radial-gradient(100% 100% at 50% 0, #2d2d2d 0, #1c1c1c 130%);
    width: 100%;
    transition: 0.2s all;
    height: 105px;
    align-items: center;
    position: relative;
    box-shadow: 0 8px 20px #0000001a;
    justify-items: center;
}

.gift-item:hover {
	opacity: 0.8;
	transform: scale(1.05);
}

.gift-image {
	width: 65px;
	height: 65px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.gift-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.gift-info {
	display: flex;
	gap: 4px;
	color: #fff;
	pointer-events: none;
	transition: 0.2s all;
	flex-direction: column;
}

.gift-name {
	font-weight: 700;
	font-size: 14px;
}

.gift-comment {
	    font-weight: 600;
    color: #ffffff;
    font-size: 11px;
    line-height: 15px;
    margin-top: 8px;
    margin-bottom: 10px;
}

.gift-from {
	    font-size: 10px;
    width: fit-content;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    display: flex;
    font-weight: 600;
    color: #ffffff;
    gap: 5px;
    padding: 3px 13px;
    background: var(--GLOBAL, radial-gradient(15660% 100% at 50% 0, #ab2626 0, #691515 100%));
}

.gift-from a{color: #fff;font-size: 10px;}

.gift-date {
	    display: flex;
    gap: 5px;
    align-items: center;
    color: #858585;
    font-size: 10.5px;
    font-weight: 600;
}

.gift-price-block {
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 6px;
}

.gift-price-block .btn,
.gift-price-block button {
	background: var(--gift-accent);
	border: none;
	color: #fff;
	border-radius: 10px;
	height: 36px;
	width: 36px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: 0.2s ease;
}

.gift-actions .btn {
	background: #343445;
	border: 1px solid #464658;
	color: #d9d9e6;
	border-radius: 10px;
	padding: 6px 10px;
	font-size: 11.5px;
	font-weight: 700;
}

.gift-actions .btn:hover {
	border-color: #4fea9f63;
	color: #ffffff;
}

.gift-price-block .btn:hover,
.gift-price-block button:hover {
	opacity: 0.8;
}

.gift-price-block .btn i,
.gift-price-block button i {
	font-size: 16px;
}

/* Market */
.market-gift-item {
	display: grid;
	grid-template-columns: 70px 1fr auto;
	gap: 10px;
	align-items: center;
	background: var(--gift-panel);
	border: 1px solid var(--gift-border);
	border-radius: 14px;
	padding: 12px;
	box-shadow: 0 10px 22px #0000001c;
}

.market-gift-item img {
	width: 70px;
	height: 70px;
	border-radius: 12px;
	object-fit: contain;
	background: #242430;
}

.market-gift-info {
	display: grid;
	gap: 5px;
	color: var(--gift-text);
}

.market-gift-name {
	font-weight: 700;
	font-size: 14px;
}

.market-gift-seller {
	font-size: 11.5px;
	color: var(--gift-muted);
}

.market-gift-seller a {
	color: #67c196;
	font-weight: 600;
}

.market-gift-price-block {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.market-gift-price {
	background: #363646;
	color: var(--gift-text);
	font-weight: 700;
	font-size: 12.5px;
	padding: 7px 10px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.market-gift-price i {
	color: #67c196;
}

.market-gift-price-block .btn {
	width: 40px;
	height: 40px;
	border-radius: 12px;
}

/* Modal categories and grid */
.gift-modal-categories {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.gift-category-btn {
	border: 1px solid var(--gift-border);
	background: #2e2e3a;
	color: var(--gift-text);
	border-radius: 10px;
	padding: 8px 12px;
	font-weight: 600;
	font-size: 12px;
	transition: 0.2s ease;
}

.gift-category-btn:hover,
.gift-category-btn.active {
	border-color: #4fea9f63;
	background: #34403b;
	color: #67c196;
}

.gifts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.gift-selector-item {
	background: var(--gift-panel);
	border: 1px solid var(--gift-border);
	border-radius: 12px;
	padding: 10px;
	display: grid;
	grid-template-columns: 60px 1fr;
	gap: 10px;
	align-items: center;
	cursor: pointer;
	transition: 0.2s ease;
}

.gift-selector-item:hover {
	border-color: #4fea9f63;
	box-shadow: 0 12px 24px #00000022;
}

.gift-selector-item.selected {
	border-color: #4fea9f;
	box-shadow: 0 12px 24px #00000033;
}

.gift-selector-item img {
	width: 60px;
	height: 60px;
	object-fit: contain;
	background: #242430;
	border-radius: 10px;
}

.gift-selector-item-info {
	display: grid;
	gap: 4px;
}

.gift-selector-item .gift-price {
	color: #67c196;
	font-weight: 700;
	font-size: 12px;
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.gift-send-form {
	margin-top: 8px;
	padding: 12px;
	border-radius: 14px;
	background: #2c2c38;
	border: 1px solid var(--gift-border);
}

.selected-gift-preview {
	display: flex;
	gap: 12px;
	align-items: center;
	background: #252530;
	border-radius: 12px;
	padding: 10px;
	border: 1px dashed #4fea9f40;
}

.selected-gift-preview img {
	width: 60px;
	height: 60px;
	object-fit: contain;
	background: #1f1f28;
	border-radius: 10px;
}

.selected-gift-preview.show {
	box-shadow: 0 12px 22px #00000025;
}

.gift-send-form .form-control,
.gift-send-form textarea {
	background: #1f1f29;
	border: 1px solid #343445;
	color: var(--gift-text);
	border-radius: 10px;
}

.gift-send-form .form-control:focus,
.gift-send-form textarea:focus {
	border-color: #4fea9f70;
	box-shadow: 0 0 0 0.1rem #4fea9f40;
}

.gift-send-form .btn-primary {
	background: var(--gift-accent);
	border: none;
	font-weight: 700;
	border-radius: 12px;
}

.gift-send-form .btn-primary:hover {
	opacity: 0.9;
}

.gift-send-form .custom-control-label {
	color: var(--gift-text);
}

.gift-send-form .form-text {
	color: var(--gift-muted);
}

/* User gifts block */
.block .gifts-container {
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.block_head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.block_head .btn {
	background: var(--gift-accent);
	border: none;
	border-radius: 12px;
	font-weight: 700;
}

.block_head .btn:hover {
	opacity: 0.85;
}

/* Tile view for compact gifts */
.gift-item.gift-tile {
	grid-template-columns: 1fr;
	justify-items: center;
	text-align: center;
	position: relative;
	overflow: visible;
	cursor: pointer;
}

.gift-item.gift-tile .gift-image {
	width: 90px;
	height: 90px;
	background: linear-gradient(180deg, #252530 0%, #1f1f28 100%);
	border: 1px solid #383849;
	box-shadow: 0 10px 22px #0000001f;
}

.gift-item.gift-tile .gift-info,
.gift-item.gift-tile .gift-price-block,
.gift-item.gift-tile .gift-actions {
	display: none;
}

.gift-item.gift-tile:hover {
	border-color: #4fea9f70;
	box-shadow: 0 12px 26px #0000002e;
	z-index: 10;
}

/* Custom tooltip on hover */
.gift-item.gift-tile::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: linear-gradient(135deg, #2e2e3a 0%, #25252f 100%);
	color: #ffffff;
	padding: 10px 14px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	white-space: pre-line;
	text-align: left;
	min-width: 220px;
	max-width: 320px;
	border: 1px solid #4fea9f70;
	box-shadow: 0 16px 32px #00000040;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 100;
}

.gift-item.gift-tile::before {
	content: '';
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid #4fea9f70;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 100;
}

.gift-item.gift-tile:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(-4px);
}

.gift-item.gift-tile:hover::before {
	opacity: 1;
}

/* All gifts modal override */
.all-gifts-modal .modal-content {
	background: #21212b;
	color: var(--gift-text);
	border-radius: 16px;
	border: 1px solid var(--gift-border);
}

.all-gifts-modal .modal-header {
	border-color: #2f2f3d;
}

.all-gifts-modal .close {
	color: var(--gift-muted);
}

.all-gifts-modal #allGiftsModalBody {
	background: #1c1c25;
	border-radius: 12px;
	border: 1px solid #2f2f3c;
	padding: 12px;
}

.all-gifts-modal #allGiftsModalBody .gift-item {
	padding: 10px;
}

.order-is-last {
	order: 2;
}

@media (max-width: 991px) {
	.order-is-first { order: 2; }
	.order-is-last { order: 1; }
	.gift-item,
	.market-gift-item { grid-template-columns: 1fr; }
	.gift-price-block,
	.market-gift-price-block { justify-self: start; }
}

@keyframes spin {
	to { transform: rotate(360deg); }
}
