/* START OF FILE album-creator.css */

/* Styles for the Album Creator page */

.album-creator-container {
    padding: 20px;
    max-width: 1600px; /* Allow container to be wider */
    margin: 20px auto;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#album-selection-section,
#creator-interface-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#album-list .album-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#album-list .album-item:hover {
    background-color: #f0f0f0;
}

#album-list .album-item span {
    margin-right: 10px;
}
#album-list .album-item .album-status {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}


#new-album-form {
    margin-top: 15px;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

/* Styling for the new album size dropdown */
#new-album-form .form-group {
    margin-top: 10px;
    margin-bottom: 10px;
}
#new-album-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
#new-album-form .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}


#creator-interface-section h2 {
    margin-bottom: 5px;
}
#current-album-size-display { /* Style for displaying current album size */
    font-style: italic;
    color: #555;
    margin-top: -10px; /* Adjust spacing */
    margin-bottom: 15px;
    font-size: 0.9em;
}
#edit-album-name-input {
    margin-bottom: 15px;
}


.creator-columns {
    display: flex;
    gap: 30px; /* Increased gap */
    margin-top: 20px;
    flex-wrap: wrap; /* Allow columns to wrap on smaller screens */
    align-items: flex-start; /* Align items to the top */
}

.creator-column {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fafafa;
    box-sizing: border-box;
}

/* Explicitly define column widths */
#image-column {
    flex: 0 0 300px; /* Fixed width for image column */
}

#layout-column {
    flex: 1 1 auto; /* Let layout column take remaining space */
}


#image-column h3, #layout-column h3 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

#album-image-upload {
    margin-bottom: 10px;
}

#album-image-list {
    margin-top: 15px;
    max-height: 400px; /* Limit height */
    overflow-y: auto; /* Add scroll */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid #ddd;
    padding: 10px;
    min-height: 100px; /* Ensure it has some height even when empty */
    background-color: #fff;
}

#album-image-list img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: grab; /* Indicate draggable */
}

#template-selector {
    margin-bottom: 20px;
}

/* --- Layout Area Styling --- */
#album-layout-area {
    border: 2px dashed #ccc;
    width: 100%;
    position: relative;
    background-color: #fff;
    overflow: hidden;
    margin-top: 10px;
    aspect-ratio: 2 / 1; /* Default */
}

.spread-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    gap: 0;
}

.page {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    background-color: transparent;
}

.left-page {
    border-right: 1px solid #ccc;
}

.right-page {
    border-left: none;
}

/* Placeholder styles */
.placeholder {
    position: absolute;
    background-color: transparent;
    display: flex; /* Keep flex for vertical centering in some cases */
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #777;
    overflow: hidden; /* Crucial for clipping */
    box-sizing: border-box;
    position: relative; /* For absolute children like buttons and images */
}

/* Style for EMPTY placeholders */
.placeholder:not(:has(img)) {
    border: 1px dashed #ccc;
    background-color: #e9e9e9;
}
.placeholder:not(:has(img)) span {
    padding: 5px;
    text-align: center;
    pointer-events: none;
}

/* Style for FILLED placeholders */
.placeholder:has(img) {
     border: 1px solid #aaa;
}

/* --- Image inside placeholder --- */
.placeholder img {
    display: block;
    pointer-events: none; /* Default: not interactive */
    user-select: none; /* Prevent text selection during drag */
    -webkit-user-drag: none; /* Prevent native image drag */
    /* Styles below are applied/overridden by JS classes */
    position: absolute; /* <<< Make absolute by default */
    top: 0;             /* <<< Default top */
    left: 0;            /* <<< Default left */
    /* width/height/object-fit/transform set by JS/classes */
}

/* --- Specific styles applied by JS --- */
.placeholder img.fit-contain {
    position: static; /* Override absolute for contain */
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: default;
    transform: none !important;
    pointer-events: none;
    /* Reset top/left for contain mode */
    top: auto;
    left: auto;
}

.placeholder img.fit-cover {
    /* position: absolute; is default now */
    /* object-fit: cover; NO - JS handles scaling */
    cursor: grab;
    pointer-events: auto;
    /* Width, Height, Top, Left set by JS */
    transform: none; /* Reset transform, use top/left for positioning */
    transform-origin: 0 0;
}

.placeholder img.panning {
    cursor: grabbing;
}
/* --- End Specific styles --- */


/* Fit Toggle Button Styles */
.fit-toggle-btn {
    position: absolute;
    bottom: 3px;
    right: 3px;
    padding: 2px 5px;
    font-size: 0.7em;
    line-height: 1.2;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s, background-color 0.2s;
}
.placeholder:hover .fit-toggle-btn {
    opacity: 1;
}
.fit-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}


.album-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button.danger { background-color: #dc3545; color: white; border-color: #dc3545; }
button.danger:hover { background-color: #c82333; border-color: #bd2130; }
button { padding: 8px 15px; border: 1px solid #ccc; background-color: #f0f0f0; border-radius: 4px; cursor: pointer; font-size: 0.9em; }
button:hover { background-color: #e0e0e0; }
input[type="text"], select { padding: 8px; border: 1px solid #ccc; border-radius: 4px; margin-right: 5px; box-sizing: border-box; }

.spread-navigation { text-align: center; margin: 15px 0; }
.spread-navigation button { margin: 0 10px; }
#spread-indicator { display: inline-block; min-width: 100px; text-align: center; font-weight: bold; }
.album-actions #request-changes-btn {
    /*
       Use inline-block to match what the JS sets.
       Add !important ONLY if a less specific rule below doesn't work,
       as it might indicate a very specific conflicting rule elsewhere.
    */
    display: inline-block;

    /* Reset other potential hiding properties just in case */
    visibility: visible;
    opacity: 1;
    width: auto;
    height: auto;
    position: static; /* Reset potential absolute positioning */
    vertical-align: middle; /* Align vertically with other buttons */
}

/* --- Order Print Modal Styling --- */
.modal {
    /* Existing styles from styles.css likely handle display, position, z-index, background */
    /* Add specific overrides or additions here if needed */
}

.modal .modal-content {
    /* Existing styles from styles.css likely handle background, padding, border-radius, width */
    max-width: 600px; /* Adjust max-width as needed */
    text-align: left; /* Ensure content is left-aligned */
}

.modal .modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal .modal-content h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}


#order-print-form .form-group {
    margin-bottom: 15px;
}

#order-print-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

#order-print-form input[type="text"],
#order-print-form input[type="tel"],
#order-print-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

#order-print-form select {
    appearance: none; /* Optional: for custom dropdown arrow styling */
    background-color: #fff; /* Ensure background for select */
}

#order-print-form input[type="radio"] {
    margin-right: 5px;
}
#order-print-form input[type="radio"] + label {
    font-weight: normal; /* Normal weight for radio labels */
    margin-right: 15px; /* Space between radio options */
}

#selected-product-details {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 0.9em;
}
#selected-product-details p {
    margin: 5px 0;
}

#order-print-form hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 25px 0;
}

#order-print-form button[type="submit"] {
    display: block; /* Make button full width */
    width: 100%;
    padding: 12px 20px;
    font-size: 1em;
    margin-top: 20px;
}
/* Add to album-creator.css or styles.css */
.modal { display: none; position: fixed; z-index: 1050; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fff; margin: 10% auto; padding: 0; border: 1px solid #ccc; width: 90%; border-radius: var(--border-radius); box-shadow: 0 5px 15px rgba(0,0,0,0.2); animation: modalContentSlideDown 0.4s ease-out; }
.modal-header { padding: 1rem 1.5rem; background: #f8f9fa; border-bottom: 1px solid #dee2e6; display: flex; justify-content: space-between; align-items: center; border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius); }
.modal-header h3 { margin: 0; font-size: 1.2rem; color: var(--header-bg); }
.modal-body { padding: 1.5rem; }
.close-button { color: #aaa; font-size: 1.8rem; font-weight: bold; cursor: pointer; background: none; border: none; line-height: 1; }
.close-button:hover { color: #333; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } /* For accessibility */

@keyframes modalContentSlideDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }

/* END OF FILE album-creator.css */
