/* =============================================
   WOODROCKS CMS ADMIN STYLES
   ============================================= */

/* Admin trigger button */
.cms-trigger {
    position: fixed; bottom: 20px; left: 20px; z-index: 9990;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(42,42,42,0.15); border: 1px solid rgba(42,42,42,0.1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0.15; transition: all 0.3s;
    font-size: 16px; color: #2a2a2a;
}
.cms-trigger:hover { opacity: 1; background: rgba(42,42,42,0.9); color: #fff; transform: scale(1.1); }

/* Login overlay */
.cms-login-overlay {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(14,26,36,0.92); backdrop-filter: blur(20px);
    display: none; align-items: center; justify-content: center;
}
.cms-login-overlay.active { display: flex; }
.cms-login-box {
    background: #1a2a35; border: 1px solid rgba(201,169,98,0.2);
    border-radius: 16px; padding: 3rem; max-width: 380px; width: 90%;
    text-align: center;
}
.cms-login-box h2 {
    font-family: 'Playfair Display', serif; font-size: 1.5rem;
    color: #f8f6f3; margin-bottom: 0.5rem;
}
.cms-login-box p { font-size: 0.85rem; color: rgba(255,255,255,0.4); margin-bottom: 2rem; }
.cms-login-input {
    width: 100%; padding: 1rem; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    color: #f8f6f3; font-family: 'Space Grotesk', sans-serif; font-size: 1rem;
    outline: none; margin-bottom: 1rem; transition: border-color 0.3s;
}
.cms-login-input:focus { border-color: rgba(201,169,98,0.5); }
.cms-login-btn {
    width: 100%; padding: 1rem; background: var(--gold, #c9a962);
    border: none; border-radius: 8px; color: #0a0a0a;
    font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem;
    font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    cursor: pointer; transition: all 0.3s;
}
.cms-login-btn:hover { background: #d4b87a; transform: translateY(-1px); }
.cms-login-error { color: #e74c3c; font-size: 0.8rem; margin-top: 0.5rem; display: none; }
.cms-login-close {
    position: absolute; top: 2rem; right: 2rem; width: 40px; height: 40px;
    border: 1px solid rgba(255,255,255,0.15); border-radius: 50%;
    background: none; color: #fff; font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.cms-login-close:hover { background: rgba(255,255,255,0.1); }

/* Floating toolbar */
.cms-toolbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000;
    background: #1a2a35; border-top: 1px solid rgba(201,169,98,0.3);
    padding: 0.8rem 2rem; display: none; align-items: center; justify-content: space-between;
    backdrop-filter: blur(20px); box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
}
.cms-toolbar.active { display: flex; }
.cms-toolbar-left { display: flex; align-items: center; gap: 1rem; }
.cms-toolbar-status {
    font-family: 'Space Grotesk', sans-serif; font-size: 0.75rem;
    color: rgba(255,255,255,0.5); letter-spacing: 0.1em; text-transform: uppercase;
}
.cms-toolbar-status .dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #2ecc71; margin-right: 8px; animation: cmsPulse 2s infinite;
}
@keyframes cmsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.cms-toolbar-right { display: flex; align-items: center; gap: 0.8rem; }
.cms-btn {
    padding: 0.6rem 1.5rem; border: none; border-radius: 6px;
    font-family: 'Space Grotesk', sans-serif; font-size: 0.75rem;
    font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
    cursor: pointer; transition: all 0.3s;
}
.cms-btn-save { background: var(--gold, #c9a962); color: #0a0a0a; }
.cms-btn-save:hover { background: #d4b87a; }
.cms-btn-save.saving { opacity: 0.6; pointer-events: none; }
.cms-btn-cancel { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1); }
.cms-btn-cancel:hover { background: rgba(255,255,255,0.15); color: #fff; }
.cms-btn-logout { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid rgba(231,76,60,0.2); }
.cms-btn-logout:hover { background: rgba(231,76,60,0.3); }
.cms-btn-panel { background: rgba(201,169,98,0.15); color: var(--gold, #c9a962); border: 1px solid rgba(201,169,98,0.2); }
.cms-btn-panel:hover { background: rgba(201,169,98,0.3); }

/* Edit mode indicators */
body.cms-edit-mode [data-cms] {
    outline: 1px dashed rgba(201,169,98,0.0); cursor: text;
    transition: outline 0.2s, background 0.2s;
}
body.cms-edit-mode [data-cms]:hover {
    outline: 1px dashed rgba(201,169,98,0.5);
    background: rgba(201,169,98,0.05);
}
body.cms-edit-mode [data-cms]:focus {
    outline: 2px solid rgba(201,169,98,0.6);
    background: rgba(201,169,98,0.08);
}
body.cms-edit-mode [data-cms-html]:hover {
    outline: 1px dashed rgba(46,204,113,0.5);
    background: rgba(46,204,113,0.05);
}
body.cms-edit-mode [data-cms-html]:focus {
    outline: 2px solid rgba(46,204,113,0.6);
    background: rgba(46,204,113,0.08);
}

/* Image edit overlay */
body.cms-edit-mode [data-cms-img] { position: relative; }
.cms-img-overlay {
    position: absolute; inset: 0; z-index: 50;
    background: rgba(14,26,36,0.6); opacity: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.5rem; transition: opacity 0.3s; cursor: pointer;
}
body.cms-edit-mode [data-cms-img]:hover .cms-img-overlay { opacity: 1; }
.cms-img-overlay-label {
    font-family: 'Space Grotesk', sans-serif; font-size: 0.7rem;
    color: #fff; letter-spacing: 0.15em; text-transform: uppercase;
    background: rgba(201,169,98,0.8); padding: 0.5rem 1.2rem;
    border-radius: 4px;
}
.cms-img-overlay-icon { font-size: 2rem; color: #fff; }

/* List item controls */
.cms-item-controls {
    position: absolute; top: 0.5rem; right: 0.5rem; z-index: 50;
    display: none; gap: 0.3rem;
}
body.cms-edit-mode .cms-item-controls { display: flex; }
.cms-item-btn {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.cms-item-btn-delete { background: rgba(231,76,60,0.8); color: #fff; }
.cms-item-btn-delete:hover { background: #e74c3c; transform: scale(1.15); }
.cms-item-btn-move { background: rgba(255,255,255,0.2); color: #fff; cursor: grab; }

/* Add item button */
.cms-add-btn {
    display: none; width: 100%; padding: 2rem; margin-top: 1rem;
    border: 2px dashed rgba(201,169,98,0.3); border-radius: 12px;
    background: rgba(201,169,98,0.04); color: rgba(201,169,98,0.6);
    font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem;
    letter-spacing: 0.1em; cursor: pointer; transition: all 0.3s;
    text-align: center;
}
body.cms-edit-mode .cms-add-btn { display: block; }
.cms-add-btn:hover {
    border-color: rgba(201,169,98,0.6);
    background: rgba(201,169,98,0.1);
    color: var(--gold, #c9a962);
}

/* Side panel for complex editing */
.cms-panel {
    position: fixed; top: 0; right: -480px; bottom: 0; width: 460px;
    z-index: 10002; background: #0f1a24;
    border-left: 1px solid rgba(201,169,98,0.15);
    box-shadow: -10px 0 40px rgba(0,0,0,0.4);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto; padding: 2rem;
}
.cms-panel.open { right: 0; }
.cms-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem; padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cms-panel-title {
    font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #f8f6f3;
}
.cms-panel-close {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15);
    background: none; color: #fff; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.3s;
}
.cms-panel-close:hover { background: rgba(255,255,255,0.1); }
.cms-panel-section {
    margin-bottom: 1.5rem; padding: 1.2rem;
    background: rgba(255,255,255,0.03); border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.cms-panel-section h3 {
    font-family: 'Space Grotesk', sans-serif; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--gold, #c9a962); margin-bottom: 1rem;
}
.cms-field { margin-bottom: 1rem; }
.cms-field label {
    display: block; font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem; color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em; text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.cms-field input, .cms-field textarea, .cms-field select {
    width: 100%; padding: 0.7rem; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
    color: #f8f6f3; font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem;
    outline: none; transition: border-color 0.3s;
}
.cms-field input:focus, .cms-field textarea:focus {
    border-color: rgba(201,169,98,0.4);
}
.cms-field textarea { resize: vertical; min-height: 80px; }

/* Image picker in panel */
.cms-img-picker {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    max-height: 300px; overflow-y: auto; margin-top: 0.5rem;
    padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: 8px;
}
.cms-img-picker img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 4px; cursor: pointer; border: 2px solid transparent;
    transition: all 0.2s;
}
.cms-img-picker img:hover { border-color: var(--gold, #c9a962); transform: scale(1.05); }
.cms-img-picker img.selected { border-color: #2ecc71; }

/* Notification toast */
.cms-toast {
    position: fixed; top: 2rem; right: 2rem; z-index: 10003;
    padding: 1rem 2rem; border-radius: 8px; font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem; transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.cms-toast.show { transform: translateX(0); }
.cms-toast.success { background: #1a3c2a; color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.cms-toast.error { background: #3c1a1a; color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.cms-toast.info { background: #1a2a3c; color: #3498db; border: 1px solid rgba(52,152,219,0.3); }

/* Hidden file input */
.cms-file-input { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .cms-panel { width: 100%; right: -100%; }
    .cms-toolbar { flex-direction: column; gap: 0.5rem; padding: 0.5rem 1rem; }
    .cms-toolbar-right { flex-wrap: wrap; justify-content: center; }
}
