.billboard-customizer-container {
    font-family: 'Inter', sans-serif;
}
/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.controls-section {
    overflow-y: auto !important;
	height:600px !important;
}
#middleColumnContent {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
    min-height: 400px; 
    width: 100%; /* Added for explicitness, though Tailwind's w-full should handle this */
    /* h-full is removed here, min-height will dictate its height primarily */
}
#textPreviewContainer {
    position: absolute; 
    display: flex;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    transition: top 0.3s ease, left 0.3s ease, transform 0.3s ease, width 0.3s ease;
    -webkit-transition: top 0.3s ease, left 0.3s ease, -webkit-transform 0.3s ease, width 0.3s ease;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
}
#textPreview, #textPreview2 {
    font-size: 24px;
    font-family: Arial, sans-serif;
    color: #000000;
    white-space: pre-wrap;
    word-break: break-word; 
    width: 100%;
}

#textPreview2.hidden, #textInputContainer2.hidden {
    display: none;
}
.thumbnail-container img {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.thumbnail-container img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.control-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem; 
    font-weight: 500; 
    color: #374151; 
}
.control-input, .control-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #D1D5DB; 
    border-radius: 0.375rem; 
    box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.control-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background-color: #4F46E5; 
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
    border: 2px solid transparent;
}
.control-button:hover {
    background-color: #4338CA; 
}
.control-button.active {
    background-color: #3730A3; 
    border-color: #6366F1; 
}
.pos-btn { 
    padding: 0.5rem; 
    font-size: 0.75rem; 
    line-height: 1;
    text-align: center;
}
.category-button {
    background-color: #E5E7EB; 
    color: #374151; 
}
.category-button.active {
    background-color: #4F46E5; 
    color: white !important; 
}

button.category-button:hover {
  background-color: #4F46E5 !important;
  color: white !important;
}


#messageBox {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #10B981; 
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none; 
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
#messageBox.show {
    display: block;
    opacity: 1;
}
.color-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s;
}
.color-swatch:hover {
    transform: scale(1.1);
}

/* Mobile specific adjustments */
@media (max-width: 767px) { /* Tailwind's 'md' breakpoint is 768px, so this targets below 'md' */
    .container {
        /* Allow container to show all its content, to ensure body scroll works correctly if container content is too tall */
        overflow: visible; 
    }

    main { /* Target the main element specifically */
        position: static !important; /* Ensure it's not sticky or fixed */
    	display: flex; /* Simplify display from flex to block for stacking flow */
		flex-direction: column;
		gap: 1.5rem;

    }
	
	

/*   #middleColumnContent {
		order:0 !important;
        /* h-full was removed from general style, ensure w-full is effectively applied or set here if needed */
      /*  width: 100%; 
		 }  */
	#middleColumnContent {
        order: 1 !important; /* Main content first */
        width: 100%; 
		 margin-bottom: 1rem;
    }

    .controls-section:first-of-type {
        order: 3 !important;
		 margin-top: 1rem; /* Background Images section last */
    }

    .controls-section:last-of-type {
        order: 2 !important; /* Text Controls section second */
		margin: 1rem 0;
    }

    .controls-section {
         max-height: 60vh; /* Allow more height for controls when stacked on mobile */
         overflow-y: auto; /* Ensure internal scrolling for controls */
		padding: 1rem;
    }
}

/* Draggable Text Box Styles */
.draggable-text-box {
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: move;
}

.draggable-text-box:not(.dragging) {
    transition: all 0.2s ease;
}

.draggable-text-box.dragging {
    transition: none;
    z-index: 1000;
}

/* Bounding Box Styles */
.bounding-box {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px dashed #3B82F6;
    border-radius: 4px;
    z-index: 1000;
    background: none;
    pointer-events: none;
}

.bounding-box.hidden {
    display: none !important;
}

/* Resize Handles */
.resize-handle, .rotation-handle {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}

.resize-handle-nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle-ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle-sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle-se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.resize-handle-n {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
    z-index: 1100;
}

.resize-handle-s {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
    z-index: 1100;
}

.resize-handle-e {
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    cursor: ew-resize;
    z-index: 1100;
}

.resize-handle-w {
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    cursor: ew-resize;
    z-index: 1100;
}

/* Rotation Handle */
.rotation-handle {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    border: 2px solid white;
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.rotation-handle:active {
    cursor: grabbing;
}

.rotation-handle::before {
    content: '↻';
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    display: block;
    width: 100%;
    height: 100%;
    text-align: center;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.rotation-handle:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.rotation-handle:hover::after {
    content: 'Rotate';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #374151;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 30;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Text Element Styles */
.text-element {
    position: relative;
    z-index: 5;
}

/* Hover effects for drag mode */
.draggable-text-box:hover .bounding-box:not(.hidden) {
    border-color: #1D4ED8;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.resize-handle:hover {
    background-color: #1D4ED8;
    transform: scale(1.1);
}



/* Mode button styles */
.mode-btn {
    background-color: #6B7280;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
    border: 2px solid transparent;
}

.mode-btn:hover {
    background-color: #4B5563;
}

.mode-btn.active {
    background-color: #3B82F6;
    border-color: #60A5FA;
}

/* Disable text selection during drag */
.draggable-text-box.dragging * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Rotation indicator */
.draggable-text-box.rotating {
    transition: none;
}

.draggable-text-box.rotating .bounding-box {
    border-color: #10B981;
    border-width: 3px;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #3B82F6;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1100;
}
