/* Mobile-specific styles for cell phones */

/* General mobile optimizations for 3D viewer */
@media (max-width: 768px) {
	#shelf-wrapper {
		position: static;
		transform: none;
		width: 100%;
		padding: 10px;
		gap: 10px;
	}

	#filter-bar {
		width: 100%;
	}

	#filter-controls-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 42px;
		border-radius: 6px;
		border: 1px solid #00d4ff;
		background: rgba(20, 40, 70, 0.6);
		color: #00d4ff;
		font-size: 13px;
		cursor: pointer;
		transition: all 0.2s;
		font-family: 'Courier New', monospace;
		text-transform: uppercase;
		letter-spacing: 0.08em;
	}

	#filter-controls-toggle:active {
		transform: scale(0.98);
	}

	#filter-bar .filter-row {
		display: none;
	}

	#filter-bar.is-open .filter-row {
		display: flex;
	}

	.filter-row {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
	}

	.filter-group {
		min-width: 0;
		gap: 4px;
	}

	.search-group {
		flex: 0 0 auto;
	}

	#filter-clear {
		align-self: stretch;
	}

	.filter-az {
		justify-content: center;
	}

	.drag-hint {
		width: 36px;
		height: 36px;
	}

	/* Make side faces smaller on mobile (1/3 smaller = 2/3 of original) */
	.left, .right {
		width: 16.67mm;
	}

	.top, .bottom {
		height: 16.67mm;
	}

	/* Ensure left/right images fill their faces properly */
	.left img, .right img {
		width: 100%;
		height: 100%;
		object-fit: fill;
	}

	/* Adjust top/bottom images for smaller faces */
	.top img {
		width: 17%;
		height: 583%;
		object-fit: fill;
	}

	.bottom img {
		width: 17%;
		height: 583%;
		object-fit: fill;
	}

	/* Adjust positioning for smaller side faces */
	.front {
		transform: translate(-50%,-50%) translateZ(8.335mm);
	}

	.back {
		transform: translate(-50%,-50%) rotateY(180deg) translateZ(8.335mm);
	}

	.left {
		transform: translate(-50%,-50%) rotateY(-90deg) translateZ(49mm);
	}

	.right {
		transform: translate(-50%,-50%) rotateY(90deg) translateZ(49mm);
	}

	.top {
		transform: translate(-50%,-50%) rotateX(90deg) translateZ(90mm);
	}

	.bottom {
		transform: translate(-50%,-50%) rotateX(-90deg) translateZ(90mm);
	}
}

/* PORTRAIT MODE - Mobile phones held vertically */
@media (max-width: 768px) and (orientation: portrait) {
	.carousel-arrow {
		display: none;
	}

	.carousel-controls-hint {
		display: none;
	}

	.carousel-controls-hint-mobile {
		display: block;
		position: fixed;
		bottom: 20px;
		left: 50%;
		transform: translateX(-50%);
		background: rgba(255,255,255,0.1);
		padding: 8px 15px;
		border-radius: 5px;
		font-size: 12px;
		z-index: 2;
		text-align: center;
	}

	#shelf {
		position: static;
		transform: none;
		height: 100vh;
		max-height: 100vh;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
		overflow-y: auto;
		overflow-x: hidden;
		padding: 10px;
		gap: 10px;
		background: rgba(0, 0, 0, 0.5);
	}

	#carousel-container {
		flex-direction: row;
		align-items: center;
		height: auto;
		gap: 10px;
		overflow-x: auto;
		overflow-y: hidden;
		width: 100%;
	}

	#left-side,
	#right-side {
		flex-direction: row;
		flex-wrap: nowrap;
		width: auto;
		gap: 8px;
	}

	#focal-movie {
		width: auto;
		display: flex;
		justify-content: center;
	}

	.vhs-tape {
		width: clamp(96px, 28vw, 150px);
		aspect-ratio: 5 / 9;
		height: auto;
	}

	.vhs-tape.focal {
		width: clamp(180px, 52vw, 280px);
		aspect-ratio: 5 / 9;
		height: auto;
		box-shadow: 0 8px 24px rgba(0,0,0,0.8);
		border: 2px solid rgba(255,255,255,0.3);
	}

	.tape-spine {
		flex-direction: column;
		width: 100%;
		height: 100%;
	}

	.spine-image {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.vhs-tape:hover {
		transform: none;
	}

	.vhs-tape:active {
		transform: scale(0.98);
		box-shadow: 0 5px 15px rgba(0,0,0,0.7);
	}

	.instructions {
		bottom: 10px;
		left: 50%;
		transform: translateX(-50%);
		width: 90%;
		font-size: 12px;
		padding: 8px 12px;
	}

	.context-menu {
		min-width: 140px;
		font-size: 12px;
	}

	.context-menu-option {
		padding: 8px 12px;
		font-size: 12px;
	}

	.context-menu-option:hover {
		padding-left: 16px;
	}
}

/* LANDSCAPE MODE - Mobile phones held horizontally */
@media (max-width: 768px) and (orientation: landscape) {
	/* Hide carousel arrows on mobile */
	.carousel-arrow {
		display: none;
	}

	/* Swap hints for mobile */
	.carousel-controls-hint {
		display: none;
	}

	.carousel-controls-hint-mobile {
		display: block;
		position: fixed;
		bottom: 20px;
		left: 50%;
		transform: translateX(-50%);
		background: rgba(255,255,255,0.1);
		padding: 8px 15px;
		border-radius: 5px;
		font-size: 12px;
		z-index: 2;
		text-align: center;
	}

	#shelf {
		flex-wrap: nowrap; /* Single row */
		overflow-x: auto; /* Horizontal scrolling */
		overflow-y: hidden;
		gap: 4px;
		padding: 10px;
	}

	.vhs-tape {
		width: 96px; /* Narrower for landscape */
		height: 170px;
		flex: 0 0 auto;
	}

	/* Make focal movie larger in landscape mode */
	.vhs-tape.focal {
		width: 138px;
		height: 222px;
		box-shadow: 0 8px 24px rgba(0,0,0,0.8);
		border: 2px solid rgba(255,255,255,0.3);
	}

	/* Side movies stay smaller */
	.vhs-tape.side {
		opacity: 0.8;
	}

	.spine-title {
		font-size: 10px;
		padding: 8px;
	}

	.context-menu {
		min-width: 140px;
		font-size: 11px;
	}

	.context-menu-option {
		padding: 8px 12px;
		font-size: 11px;
	}
}
