/* CMS Specific Styles */

.cms-editing .editable {
    outline: 2px dashed rgba(0, 122, 184, 0.3);
    outline-offset: 4px;
    cursor: text;
}

.cms-editing .editable:focus {
    outline: 2px solid #007AB8;
    background-color: rgba(0, 122, 184, 0.05);
}

.cms-editing .image-placeholder {
    cursor: pointer;
    position: relative;
}

.cms-editing .image-placeholder::after {
    content: 'Click to edit';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.cms-editing .image-placeholder:hover::after {
    opacity: 1;
}

#cms-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #333;
    color: white;
    padding: 10px 20px;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-family: sans-serif;
}

#cms-toolbar .cms-actions {
    display: flex;
    gap: 10px;
}

#cms-toolbar button {
    background: #555;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

#cms-toolbar button:hover {
    background: #666;
}

#cms-toolbar button.danger {
    background: #d63031;
}

#cms-toolbar button.danger:hover {
    background: #e17055;
}

/* Adjust body to accounting for toolbar */
.cms-editing {
    padding-top: 50px;
}

/* Hero Edit Button */
#hero-bg-edit-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
    z-index: 10;
}

#hero-bg-edit-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Adjust for Mobile Menu Button to prevent overlap */
@media (max-width: 768px) {
    #hero-bg-edit-btn {
        bottom: 90px;
    }
}

/* CMS Modal */
.cms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cms-modal {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cms-modal-header {
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cms-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.cms-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.cms-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.cms-form-group {
    margin-bottom: 15px;
}

.cms-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.cms-form-group input,
.cms-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.cms-form-group textarea {
    height: 100px;
    resize: vertical;
}

.cms-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    background: #007AB8;
    color: white;
}

.cms-btn:hover {
    background: #005a87;
}

.cms-btn.secondary {
    background: #ccc;
    color: #333;
}

.cms-btn.secondary:hover {
    background: #bbb;
}

.cms-btn.danger {
    background: #d63031;
    color: white;
}

.cms-news-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.cms-news-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cms-news-item:last-child {
    border-bottom: none;
}

.cms-news-info {
    flex: 1;
}

.cms-news-date {
    font-weight: bold;
    margin-right: 10px;
    color: #555;
}

.cms-news-actions {
    display: flex;
    gap: 5px;
}

img.image-placeholder {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    background: #f0f0f0;
    /* Light background for loading/transparency */
}

img.image-placeholder:hover {
    opacity: 0.9;
}