.editor-main-container {
    padding: 3rem;
    background: rgba(15, 15, 25, 0.4);
    border-radius: 20px;
    max-width: 100%;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-header h2 {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.close-editor-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 10px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.close-editor-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: scale(1.05);
}

.editor-layout {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.editor-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.meta-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-input,
.modern-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    color: white;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.modern-input:focus,
.modern-select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.modern-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

textarea.modern-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

.content-editor-section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

#editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
}

#editor-toolbar button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

#editor-toolbar button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

#editor-toolbar button.active {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
}

#editor-toolbar .divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
}

#enhance-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2)) !important;
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
    color: #a78bfa !important;
    padding: 0.6rem 1.2rem !important;
    width: auto !important;
    height: auto !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    gap: 0.5rem !important;
    border-radius: 8px !important;
    margin-left: auto;
}

#enhance-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.3)) !important;
    border-color: #a78bfa !important;
    color: #c4b5fd !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

#enhance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.editor-canvas-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-height: 500px;
    max-height: 700px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

#editor {
    padding: 2rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    line-height: 1.8;
    outline: none;
    min-height: 500px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    width: 100%;
}

#editor:empty::before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

#editor h1 {
    font-size: 2rem;
    color: var(--accent);
    margin: 2rem 0 1rem;
    font-weight: 700;
}

#editor h2 {
    font-size: 1.6rem;
    color: var(--accent);
    margin: 1.5rem 0 1rem;
    font-weight: 600;
}

#editor h3 {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 1.2rem 0 0.8rem;
    font-weight: 600;
}

#editor p {
    margin-bottom: 1.2rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#editor img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.editor-right {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 100%;
}

.sidebar-title {
    color: var(--accent);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.editor-right .form-group {
    margin-bottom: 0;
}

.thumbnail-divider {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed rgba(255, 255, 255, 0.15);
}

.admin-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.status-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--secondary);
}

.status-indicator.unsaved .status-dot {
    background: #fb923c;
    animation: blink 1.5s infinite;
}

.status-indicator.saved .status-dot {
    background: var(--accent);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#save-status {
    color: var(--accent);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 1.2rem;
}

.primary-btn,
.cyber-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-btn {
    background: var(--accent);
    color: black;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cyber-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.cyber-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.cyber-btn.danger {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.cyber-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.editor-canvas-wrapper::-webkit-scrollbar,
.editor-right::-webkit-scrollbar {
    width: 8px;
}

.editor-canvas-wrapper::-webkit-scrollbar-track,
.editor-right::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.editor-canvas-wrapper::-webkit-scrollbar-thumb,
.editor-right::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.editor-canvas-wrapper::-webkit-scrollbar-thumb:hover,
.editor-right::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.resizer {
    position: absolute;
    border: 2px solid var(--accent);
    display: none;
    pointer-events: none;
    z-index: 20;
    border-radius: 4px;
}

.handle {
    width: 14px;
    height: 14px;
    background: var(--accent);
    position: absolute;
    pointer-events: auto;
    border-radius: 50%;
    border: 2px solid black;
    cursor: nwse-resize;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.img-toolbar {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--accent);
    padding: 0.5rem;
    border-radius: 10px;
    display: flex;
    gap: 0.5rem;
    pointer-events: auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.img-toolbar button {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-toolbar button:hover {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
}

.editor-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(6px);
}

.editor-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-message.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
}

.editor-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.word-count {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 1200px) {
    .meta-inputs {
        grid-template-columns: 1fr;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .editor-main-container {
        padding: 1.5rem;
    }
    
    #editor {
        font-size: 1rem;
        padding: 1.5rem;
    }
    
    .admin-bottom-bar {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .action-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .primary-btn,
    .cyber-btn {
        width: 100%;
        justify-content: center;
    }
}

@media print {
    .editor-toolbar,
    .close-editor-btn,
    .admin-bottom-bar {
        display: none;
    }
    
    .editor-canvas-wrapper {
        border: none;
        background: white;
        max-height: none;
    }
    
    #editor {
        color: black;
    }
}

#editor img.img-left {
    float: left;
    margin: 1rem 1.5rem 1rem 0;
    max-width: 50%;
}

#editor img.img-right {
    float: right;
    margin: 1rem 0 1rem 1.5rem;
    max-width: 50%;
}

#editor img.img-center {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
}

#editor img {
    cursor: pointer;
    border-radius: 8px;
    transition: opacity 0.2s;
}

#editor img:hover {
    opacity: 0.9;
}

.resizer {
    position: absolute;
    border: 2px solid var(--accent);
    pointer-events: none;
    display: none;
    z-index: 100;
}

.resizer * {
    pointer-events: all;
}

.resizer-drag-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: move;
    background: rgba(255, 255, 255, 0.05);
}

.resizer .handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border: 2px solid #000;
    border-radius: 50%;
    z-index: 101;
}

.resizer .h-nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resizer .h-ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resizer .h-sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resizer .h-se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.img-toolbar {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.img-toolbar button {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.img-toolbar button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.img-toolbar button:active {
    transform: scale(0.95);
}

#overlay-layer {
    position: relative;
    pointer-events: none;
}

#overlay-layer * {
    pointer-events: all;
}

#editor-toolbar .divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 8px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

