/* ============================================================
   Scoped reset — neutralises Twenty Twenty-Five (and any other
   theme) global styles inside the plugin wrapper only.
   Only resets properties known to conflict; does NOT wipe
   backgrounds/borders/colours which would blank the UI.
   ============================================================ */
#cilt-app *,
#cilt-app *::before,
#cilt-app *::after {
    box-sizing: border-box;
}

/* Restore sensible defaults for all elements inside the wrapper */
#cilt-app button,
#cilt-app input,
#cilt-app select,
#cilt-app label,
#cilt-app span,
#cilt-app p,
#cilt-app h3,
#cilt-app h4,
#cilt-app li,
#cilt-app a {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: normal;
    letter-spacing: normal;
    text-transform: none;
}

/* ============================================================
   Break out of Twenty Twenty-Five constrained layout.
   Strategy: use a negative margin breakout so #cilt-app
   stretches to full viewport width regardless of the parent
   content column width, without overflowing the page.
   ============================================================ */
#cilt-app {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px;
    box-sizing: border-box;
    display: block;
    /* Full-width breakout from constrained content column */
    /* width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw; */
    max-width: 100vw;
    overflow-x: hidden;
}

/* ============================================================
   Header
   ============================================================ */
#cilt-app .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#cilt-app .sheet-selector {
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 360px;
    background: white;
    color: #333;
}

#cilt-app .company-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px;
    font-weight: bold;
}

#cilt-app .company-logo img {
    max-height: 40px;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* ============================================================
   Toolbar
   ============================================================ */
#cilt-app .toolbar {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

#cilt-app .toolbar button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    font-size: 14px;
    line-height: normal;
}

#cilt-app .toolbar button:hover {
    background: #f5f5f5;
    border-color: #999;
}

#cilt-app .toolbar button.active {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}

#cilt-app .toolbar button#resetSizeBtn {
    background-color: #ff9800;
    color: white;
    border-color: #f57c00;
    border: 1px solid #f57c00;
}

#cilt-app .toolbar button#resetSizeBtn:hover {
    background-color: #e68900;
}

/* Resize slider */
#cilt-app .resize-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#cilt-app .resize-slider-wrapper label {
    color: #333;
    font-size: 14px;
}

#cilt-app #resizeSlider {
    width: 150px;
}

#cilt-app #resizeSliderValue {
    font-size: 14px;
    color: #333;
}

/* Size display */
#cilt-app .size-display {
    margin-right: auto;
    padding-left: 15px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

/* Spacer */
#cilt-app .spacer {
    flex: 1;
}

/* Size inputs */
#cilt-app .size-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

#cilt-app .size-inputs label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
}

#cilt-app .size-inputs input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
}

/* ============================================================
   Export dropdown
   ============================================================ */
#cilt-app .dropdown-wrapper {
    position: relative;
}

#cilt-app .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    color: #333;
    font-size: 14px;
}

#cilt-app .dropdown-toggle:hover {
    background: #f5f5f5;
    border-color: #999;
}

#cilt-app .dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    z-index: 1000;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#cilt-app .dropdown-menu li {
    border-bottom: 1px solid #eee;
    list-style: none;
}

#cilt-app .dropdown-menu li:last-child {
    border-bottom: none;
}

#cilt-app .dropdown-menu li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
}

#cilt-app .dropdown-menu li a:hover {
    background: #f0f0f0;
}

/* ============================================================
   Main container
   ============================================================ */
#cilt-app .main-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* ============================================================
   Preview panel
   ============================================================ */
#cilt-app .preview-panel {
    width: 250px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#cilt-app .preview-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: bold;
}

#cilt-app #previewImages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    z-index: 1;
    background: white;
}

#cilt-app .preview-image-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

#cilt-app .preview-image-container:hover {
    background: #f5f5f5;
}

#cilt-app .preview-image-container.selected {
    background: #e3f2fd;
    border-color: #2196F3;
    border: 1px solid #2196F3;
}

#cilt-app .preview-image {
    width: 100px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

#cilt-app .preview-controls {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

#cilt-app .preview-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
}

#cilt-app .preview-controls button:hover {
    color: #333;
}

/* Rotated preview section */
#cilt-app .rotated-preview-section {
    margin-top: 20px;
    padding-top: 40px;
    text-align: center;
    flex-shrink: 0;
}

#cilt-app .rotated-preview-section h4 {
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

#cilt-app .rotated-preview-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ============================================================
   Canvas container
   ============================================================ */
#cilt-app .canvas-container {
    flex-grow: 1;
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5cm;
}

#cilt-app #mainCanvas {
    background: white;
    max-width: 100%;
    max-height: 100%;
}

/* ============================================================
   Grid overlay
   ============================================================ */
#cilt-app .grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.5;
}

#cilt-app .grid-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================================
   Resize handles
   ============================================================ */
#cilt-app .resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid #2196F3;
    border-radius: 50%;
}

#cilt-app .resize-handle.left {
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    cursor: w-resize;
}

#cilt-app .resize-handle.right {
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    cursor: e-resize;
}

#cilt-app .resize-handle.top-left {
    left: -4px;
    top: -4px;
    cursor: nw-resize;
}

#cilt-app .resize-handle.top-right {
    right: -4px;
    top: -4px;
    cursor: ne-resize;
}

#cilt-app .resize-handle.bottom-left {
    left: -4px;
    bottom: -4px;
    cursor: sw-resize;
}

#cilt-app .resize-handle.bottom-right {
    right: -4px;
    bottom: -4px;
    cursor: se-resize;
}

/* ============================================================
   Drag over state
   ============================================================ */
#cilt-app .drag-over {
    outline: 2px dashed #2196F3;
    background-color: #e3f2fd;
}

header.wp-block-template-part .wp-block-group {
 display:none !important;
}