@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@300&display=swap');@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Lora:wght@400;700&family=Montserrat:wght@400;700&display=swap');
:root {
    --page-width: 8.5in;
    --page-height: 11in;
    --margin: 0.5in;
}

* {
    box-sizing: border-box;
}

a {
    color: #a855f7;
    text-decoration: none;
}

a:hover {
    color: #c084fc;
    text-decoration: underline;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #2d2d2d;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100%;
    gap: 0;
}

header {
    background-color: #2d2d2d;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    border-bottom: none;
    color: white;
    padding: 0.5rem 0 !important;
}

header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    opacity: 0.6;
    letter-spacing: 0.25em;
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

header h1:hover {
    opacity: 0.8;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Left Toolbar */
.left-toolbar {
    width: 60px;
    background-color: #212529;
    border-right: 1px solid #495057;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex-shrink: 0;
    overflow: visible;
}

.toolbar-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    position: relative;
    overflow: visible;
}

.toolbar-btn {
    width: 45px;
    height: 45px;
    border: none;
    background-color: #495057;
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.toolbar-btn:hover:not(:disabled) {
    background-color: #6c757d;
    transform: scale(1.05);
}

.toolbar-btn:active:not(:disabled) {
    background-color: #a855f7;
}

.toolbar-btn:disabled {
    background-color: #343a40;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.toolbar-favicon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.toolbar-favicon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.375rem;
    display: block;
    padding: 0;
    margin: 0;
}

.toolbar-favicon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.filter-dropdown {
    position: fixed;
    display: none !important;
    margin: 0;
    z-index: 9999;
    min-width: 200px;
    top: 0;
    left: 60px;
    height: 100vh;
    border-radius: 0;
    border: none;
    overflow-y: auto;
    background-color: #1a1d21;
    padding: 1rem 0;
}

.filter-dropdown.show {
    display: flex !important;
    flex-direction: column;
}

.effects-dropdown {
    min-width: 180px;
}

.tag-filter {
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.tag-filter:hover {
    background-color: #495057;
}

.tag-filter.active {
    background-color: #a855f7;
    color: white;
}

/* Checkbox filters */
.tag-category-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    border-bottom: 1px solid #495057;
}

.tag-category-header:first-child {
    margin-top: 0;
}

.tag-category-group {
    padding: 0.25rem 0;
}

.tag-filter-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #adb5bd;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.tag-filter-label:hover {
    background-color: #495057;
}

.tag-filter-checkbox {
    margin-right: 0.5rem;
}

.blend-mode-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #adb5bd;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.blend-mode-label:hover {
    background-color: #495057;
}

.blend-mode-radio {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #a855f7;
}

/* Image URL Modal */
.image-modal {
    position: fixed;
    display: none;
    top: 0;
    left: 60px;
    height: 100vh;
    width: 250px;
    background-color: #1a1d21;
    border: none;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

.image-modal.show {
    display: flex;
    flex-direction: column;
}

.image-modal-content {
    padding: 1.5rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-modal-content h4 {
    color: white;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.image-modal-content .form-control {
    background-color: #2d2d2d;
    border: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.875rem;
}

.image-modal-content .form-control::placeholder {
    color: #6c757d;
}

.image-modal-content .form-control:focus {
    background-color: #2d2d2d;
    border-color: #a855f7;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.image-modal-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.image-modal-buttons .btn {
    flex: 1;
    min-width: 80px;
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

/* Text Modal */
.text-modal {
    position: fixed;
    display: none;
    top: 0;
    left: 60px;
    height: 100vh;
    width: 250px;
    background-color: #1a1d21;
    border: none;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

.text-modal.show {
    display: flex;
    flex-direction: column;
}

.text-modal-content {
    padding: 1.5rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.text-modal-content h4 {
    color: white;
    font-size: 0.875rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.text-modal-content .form-control {
    background-color: #2d2d2d;
    border: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.875rem;
    resize: none;
}

.text-modal-content .form-control::placeholder {
    color: #6c757d;
}

.text-modal-content .form-control:focus {
    background-color: #2d2d2d;
    border-color: #a855f7;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.text-modal-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.text-modal-buttons .btn {
    flex: 1;
    min-width: 80px;
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

/* Font Controls */
.font-controls {
    padding-top: 0.5rem;
    border-top: 1px solid #495057;
}

.font-controls h5 {
    color: #adb5bd;
    font-size: 0.75rem;
    margin: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-group {
    margin-bottom: 0.75rem;
}

.control-group label {
    display: block;
    color: #adb5bd;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.control-group .form-control-sm {
    background-color: #2d2d2d;
    border: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.75rem;
}

.control-group .form-control-sm:focus {
    background-color: #2d2d2d;
    border-color: #a855f7;
    color: white;
}

.color-picker-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-control-color {
    width: 50px;
    height: 32px;
    padding: 2px;
    cursor: pointer;
}

.color-value {
    color: #adb5bd;
    font-size: 0.75rem;
    font-family: monospace;
    flex: 1;
}

.style-buttons {
    display: flex;
    gap: 0.25rem;
}

.style-buttons .btn {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    border-color: #495057;
    color: #adb5bd;
}

/* Overlay Panel */
.overlay-panel {
    position: fixed;
    display: none;
    top: 0;
    left: 60px;
    height: 100vh;
    width: 250px;
    background-color: #1a1d21;
    border: none;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

.overlay-panel.show {
    display: flex;
    flex-direction: column;
}

.overlay-panel-content {
    padding: 1.5rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.overlay-panel-content h4 {
    color: white;
    font-size: 0.875rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overlay-panel-content h5 {
    color: #adb5bd;
    font-size: 0.75rem;
    margin: 0.5rem 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overlay-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.overlay-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #2d2d2d;
    border: 1px solid #495057;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Layout Panel */
.layout-panel {
    position: fixed;
    display: none;
    top: 0;
    left: 60px;
    height: 100vh;
    width: 250px;
    background-color: #1a1d21;
    border: none;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

.layout-panel.show {
    display: flex;
    flex-direction: column;
}

.layout-panel-content {
    padding: 1.5rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.layout-panel-content h4 {
    color: white;
    font-size: 0.875rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.layout-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.layout-option {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.layout-option:hover {
    background-color: rgba(168, 85, 247, 0.1);
}

.layout-star-btn {
    background-color: transparent;
    border: none;
    padding: 0.25rem 0.5rem !important;
    color: #6c757d;
    transition: all 0.2s ease;
}

.layout-star-btn:hover {
    background-color: rgba(168, 85, 247, 0.1);
    transform: scale(1.2);
}

.layout-star {
    font-size: 0.9rem;
    color: #6c757d;
}

.layout-star.bi-star-fill {
    color: #FFD700;
}

.overlay-item:hover {
    border-color: #a855f7;
    background-color: #353535;
}

.overlay-item input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.overlay-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 0.875rem;
}

.overlay-controls {
    padding-top: 0.5rem;
    border-top: 1px solid #495057;
}

.overlay-blend-modes {
    padding-top: 0.5rem;
    border-top: 1px solid #495057;
}

.overlay-blend-modes h5 {
    color: #adb5bd;
    font-size: 0.75rem;
    margin: 0.5rem 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#overlay-blend-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.overlay-blend-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    color: #adb5bd;
    font-size: 0.75rem;
    cursor: pointer;
}

.overlay-blend-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.overlay-blend-label:hover {
    color: white;
}

/* Paint Panel */
.paint-panel {
    position: fixed;
    display: none;
    top: 0;
    left: 60px;
    height: 100vh;
    width: 250px;
    background-color: #1a1d21;
    border: none;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

.paint-panel.show {
    display: flex;
    flex-direction: column;
}

.paint-panel-content {
    padding: 1.5rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paint-panel-content h4 {
    color: white;
    font-size: 0.875rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paint-panel-content h5 {
    color: #adb5bd;
    font-size: 0.75rem;
    margin: 0.5rem 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paint-panel-content .control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.paint-panel-content .control-group label {
    color: #adb5bd;
    font-size: 0.75rem;
    margin: 0;
}

.paint-panel-content .form-range {
    height: 0.5rem;
}

#paintOpacityValue {
    color: #a855f7;
    font-weight: bold;
    font-size: 0.875rem;
}

.overlay-controls .form-range {
    height: 0.5rem;
}

#opacityValue {
    color: #a855f7;
    font-weight: bold;
    font-size: 0.875rem;
}

.style-buttons .btn:hover {
    border-color: #a855f7;
    color: white;
}

.style-buttons .btn.active {
    background-color: #a855f7;
    border-color: #a855f7;
    color: white;
}

/* Text Overlay */
.text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    padding: 0;
    border-radius: 0.375rem;
    border: 2px dashed transparent;
    font-weight: bold;
    color: #212529;
    cursor: grab;
    touch-action: none;
    transition: border-color 0.2s ease;
    white-space: nowrap;
    display: inline-block;
    line-height: 1;
}

#text-content {
    display: inline;
    margin: 0;
    padding: 0;
}

.text-overlay:hover,
.text-overlay:focus,
.text-overlay:active {
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

@media print {
    .text-overlay {
        border: none !important;
        box-shadow: none !important;
    }
    
    #saveHeartBtn,
    #shareBtn,
    #infoBtn,
    .no-print,
    .zoom-slider-overlay,
    .reposition-slider-overlay {
        display: none !important;
    }
}

.controls {
    background-color: white;
    padding: 1rem;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    border-top: 1px solid #dee2e6;
}

.tag-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-filter {
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-filter.active {
    background-color: #a855f7;
    border-color: #a855f7;
    color: white;
}

.collage-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 50;
    display: none;
}

.collage-container.active {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 0;
    padding: 0;
    background-color: white;
    grid-auto-flow: dense;
}

/* Column span utilities */
.col-span-1 {
    grid-column: span 1;
}

.col-span-2 {
    grid-column: span 2;
}

/* Row span utilities */
.row-span-1 {
    grid-row: span 1;
}

.row-span-2 {
    grid-row: span 2;
}

.collage-item {
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    position: relative;
}

.collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform-origin: center center;
}

.image-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 200;
}

.collage-item:hover .image-controls {
    opacity: 1;
}

.replace-icon,
.zoom-icon,
.reposition-icon {
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.replace-icon:hover,
.zoom-icon:hover,
.reposition-icon:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Zoom Slider Overlay */
.zoom-slider-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100000;
    pointer-events: auto;
    width: 90vw;
    max-width: 800px;
}

.zoom-slider-toolbar {
    background: rgba(0, 0, 0, 0.85);
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zoom-range-input {
    flex: 1;
    min-width: 150px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #6c757d 0%, #6c757d 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.zoom-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
}

.zoom-range-input::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.zoom-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
}

.zoom-range-input::-moz-range-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.zoom-percent {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

/* Reposition Sliders Overlay */
.reposition-slider-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100000;
    pointer-events: auto;
    width: 90vw;
    max-width: 800px;
}

.reposition-slider-toolbar {
    background: rgba(0, 0, 0, 0.85);
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reposition-slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reposition-label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 20px;
    font-family: 'Poppins', sans-serif;
}

.reposition-range-input {
    flex: 1;
    min-width: 150px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #6c757d 0%, #6c757d 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.reposition-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
}

.reposition-range-input::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.reposition-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
}

.reposition-range-input::-moz-range-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.reposition-value {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
    font-family: 'Poppins', sans-serif;
}

.no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #6c757d;
    font-size: 1.25rem;
}

/* Saves Panel */
.saves-panel {
    position: fixed;
    display: none;
    top: 0;
    left: 60px;
    height: 100vh;
    width: 250px;
    background-color: #1a1d21;
    border: none;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

.saves-panel.show {
    display: flex;
    flex-direction: column;
}

.saves-panel-content {
    padding: 1.5rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saves-panel-content h4 {
    color: white;
    font-size: 0.875rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.saves-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
}

.save-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #2d2d2d;
    border: 1px solid #495057;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-item:hover {
    border-color: #a855f7;
    background-color: #353535;
}

.save-item-name {
    flex: 1;
    font-size: 0.875rem;
    color: #adb5bd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.save-item-delete {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.save-item-delete:hover {
    color: #ff6b6b;
}

.saves-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid #495057;
    padding-top: 1rem;
}

/* Save Heart Button */
.save-heart-btn {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    padding: 0.5rem;
    z-index: 1000;
}

.save-heart-btn:hover {
    color: #a855f7;
    transform: scale(1.1);
}

.save-heart-btn.filled {
    color: #dc3545;
}

/* Share Button */
.share-btn {
    position: fixed;
    right: 5rem;
    bottom: 2rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    padding: 0.5rem;
    z-index: 1000;
}

.share-btn:hover {
    color: #a855f7;
    transform: scale(1.1);
}

/* Info Button */
.info-btn {
    position: fixed;
    right: 8rem;
    bottom: 2rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    padding: 0.5rem;
    z-index: 1000;
}

.info-btn:hover {
    color: #a855f7;
    transform: scale(1.1);
}

/* Letter-size page container */
.letter-page {
    aspect-ratio: 8.5 / 11;
    width: 90%;
    max-width: 500px;
    background-color: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    overflow: visible;
    position: relative;
    flex-shrink: 0;
}

.generate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    z-index: 100;
}

.generate-overlay.hidden {
    display: none !important;
}

/* Print styles for letter-sized paper */
@media print {
    @page {
        size: 8.5in 11in;
        margin: 0;
    }

    * {
        margin: 0 !important;
        padding: 0 !important;
    }

    html,
    body {
        background-color: white;
        width: 8.5in;
        height: 11in;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .app-container {
        display: block;
        width: 8.5in;
        height: 11in;
        overflow: hidden;
    }

    .left-toolbar,
    header,
    .generate-overlay,
    .controls,
    .right-sidebar {
        display: none !important;
    }

    #content-area {
        display: block !important;
        width: 8.5in;
        height: 11in;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden;
    }

    .main-content {
        display: block;
        height: 11in;
        width: 8.5in;
        overflow: hidden;
    }

    .letter-page {
        width: 8.5in !important;
        height: 11in !important;
        max-width: none;
        max-height: none;
        aspect-ratio: auto;
        box-shadow: none;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .collage-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 1fr;
        gap: 0;
        padding: 0;
        background-color: white;
        height: 11in;
        width: 8.5in;
        grid-auto-flow: dense;
        margin: 0;
        padding: 0;
    }

    .collage-item {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
    }

    .collage-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

/* Responsive grid for different screen sizes */
@media (max-width: 768px) {
    .left-toolbar {
        width: 50px;
    }
    
    .toolbar-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .collage-container {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 1fr;
        gap: 0;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .collage-container {
        grid-template-columns: 1fr;
        grid-auto-rows: 1fr;
        gap: 0;
        padding: 0;
    }

    header {
        padding: 0.25rem !important;
    }

    header h1 {
        font-size: 1.4rem;
        margin-top:2rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    .letter-page {
        margin: 0;
        position: relative;
        top: -125px;
    }

    .collage-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #paint-layer {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Override Bootstrap primary button color */
.btn-primary {
    background-color: #a855f7 !important;
    border-color: #a855f7 !important;
}

.btn-primary:hover {
    background-color: #9333ea !important;
    border-color: #9333ea !important;
}

.btn-primary:active,
.btn-primary:focus {
    background-color: #7e22ce !important;
    border-color: #7e22ce !important;
}

#imageInfoModal .modal-body table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.85rem;
}

#imageInfoModal .modal-body table thead {
    font-size: 0.8rem;
}

#imageInfoModal .modal-body table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.4rem !important;
}

#imageInfoModal .modal-body table td:last-child {
    max-width: 150px;
}

.truncate-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
