/* Consolidated style.css - Master stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f0f2f5;
    line-height: 1.6;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
header {
    background: #333;
    color: white;
    padding: 1rem;
    text-align: center;
}

.admin-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-start;  /* Align to left */
    align-items: center;
    gap: 8rem;  /* Control the exact gap you want */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-header a {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* Toolbar */
.admin-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-toolbar button {
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-toolbar button:hover {
    background: #2980b9;
}

.admin-toolbar .save-btn {
    background: #2ecc71;
}

.admin-toolbar .save-btn:hover {
    background: #27ae60;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
}

.dropdown-content a {
    color: black;
    background-color: white;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    text-align: left;  /* ADD THIS LINE */
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}



/* Layer buttons */
.layer-btn {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
    font-size: 12px;
}

.layer-btn:hover {
    background: #2980b9;
}

#pageCanvas {
    position: relative;
    flex: 1;
    background: rgba(249, 249, 249, 0);
    /* REMOVE THESE - they don't exist in saved page */
    /* margin: 20px; */
    /* border: 2px dashed #ccc; */
    /* box-shadow: inset 0 0 10px rgba(0,0,0,0.05); */
    overflow: auto;
}

/* Object styles */
.text-block, .image-block {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    user-select: none;
    transition: box-shadow 0.2s;
}

.text-block:hover, .image-block:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.text-block:focus-within, .image-block:focus-within {
    border-color: #3498db;
}

/* Drag handle */
.drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: #e67e22;
    cursor: move;
    border-radius: 6px 0 0 0;
    display: none;
}

.drag-handle:hover {
    background: #d35400;
}

/* Editor area */
.editor-area {
    border: 2px dashed #ccc;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 300px;
}

/* Form elements */
input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Login styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f0f2f5;
    padding: 1rem;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

/* Footer */
footer, .admin-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .admin-header h1 {
        margin: 0.5rem 0;
    }
    
    .admin-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #pageCanvas {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .admin-toolbar button, .dropbtn, .layer-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}


.delete-btn {
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
}

.delete-btn:hover {
    background: #c0392b;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.logout-btn:hover {
    background: #c0392b;
}


.text-editor {
    transition: font-size 0.1s ease;
}

/* Ensure dropdowns appear above all objects */
.dropdown-content {
    z-index: 10000 !important;  /* Very high value to beat any object z-index */
    position: absolute;
    background: white;
    /* keep your existing styles */
}

/* Also ensure the dropdown container doesn't clip things */
.dropdown {
    overflow: visible !important;
    z-index: 10000;
}


/* Nested dropdown styles */
.nested-dropdown {
    position: relative;
}

.nested-trigger {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.nested-content {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 10001;
}

.nested-dropdown:hover .nested-content {
    display: block;
}

/* Adjust positioning for right side of screen */
.nested-dropdown:hover .nested-content {
    left: 100%;
}

/* If near right edge, show on left instead */
@media (max-width: 1200px) {
    .nested-dropdown:hover .nested-content {
        left: auto;
        right: 100%;
    }
}


/* Link indicator */
[data-link] {
    position: relative;
    cursor: pointer;
}

[data-link]:hover::after {
    content: '🔗';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    background: white;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}



/* Video wrapper for borders and corners */
.video-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    position: relative;
    border-radius: inherit;
}

/* Force video to respect border radius */
.video-wrapper video,
.video-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit !important;
    overflow: hidden !important;
    transform: translateZ(0);
}
.image-block img,
.slideshow-slide img,
.shape-inner,
.video-wrapper {
    box-sizing: border-box;
}

#content-${scrollerId} {
    will-change: transform;
    transition: transform 0.05s linear;
}

/* For horizontal scrollers */
#content-${scrollerId}[data-horizontal="true"] {
    display: flex;
    flex-wrap: nowrap;
}

/* Hide scrollbars but keep functionality */
#${scrollerId} {
    overflow: hidden !important;
}

/* Ensure all scroller items have consistent sizing */
.scroller-item {
    flex: 0 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Make login block content resize properly */
.login-block .login-content {
    height: calc(100% - 50px) !important;
    overflow: auto !important;
    box-sizing: border-box !important;
}

/* Ensure the login block itself resizes correctly */
.login-block {
    overflow: auto !important;
}

