﻿:root {
    --primary-dark: #1f1f1f;
    --secondary-dark: #2a2a2a;
    --accent-gold: #c6b74b;
    --accent-purple: #b46f38;
    --accent-blue: #d4a574;
    --accent-red: #c6b74b;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --border-color: #2e2b2f;
    --highlight: #3a3a3a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--secondary-dark) 0%, #1a1a1a 100%);
    border-right: 2px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(198, 183, 75, 0.15);
    z-index: 1000;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(198, 183, 75, 0.1) 0%, rgba(180, 111, 56, 0.1) 100%);
}


.logoimg {
    width: 100%;
    height: auto;
    /* margin: -40px 0 -24px 0; */
}
.tagline {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin: 10px 0;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    font-weight: 500;
    user-select: none;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(198, 183, 75, 0.1);
    border-left-color: var(--accent-gold);
    padding-left: 24px;
    color: var(--accent-gold);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(198, 183, 75, 0.15), transparent);
    border-left-color: var(--accent-gold);
    color: var(--accent-gold);
}

.nav-item.parent {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-purple);
}

.nav-item.parent:hover {
    color: var(--accent-gold);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
    font-size: 14px;
}

.nav-item.parent .nav-icon {
    font-weight: bold;
}

.nav-item.parent.expanded .nav-icon {
    transform: rotate(180deg);
}

/* Estilos para pastas aninhadas */
.nav-item.parent-sub {
    padding: 10px 20px 10px 50px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    background-color: transparent;
    border-left: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-item.parent-sub:hover {
    background-color: rgba(198, 183, 75, 0.1);
    color: var(--accent-gold);
    border-left-color: var(--accent-blue);
    padding-left: 54px;
}

.nav-item.parent-sub.expanded .nav-icon {
    transform: rotate(90deg);
}

.nav-item.parent-sub .nav-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: transform var(--transition-fast);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.submenu.expanded {
    max-height: 1000px;
}

.submenu-nested {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background-color: rgba(30, 30, 30, 0.5);
}

.submenu-nested.expanded {
    max-height: 2000px;
}

/* Indentação progressiva por nível */
.nav-subitem[data-level="1"] {
    padding-left: 70px;
}

.nav-subitem[data-level="2"] {
    padding-left: 90px;
}

.nav-subitem[data-level="3"] {
    padding-left: 110px;
}

.nav-item.parent-sub[data-level="1"] {
    padding-left: 70px;
}

.nav-item.parent-sub[data-level="2"] {
    padding-left: 90px;
}

.nav-item.parent-sub[data-level="3"] {
    padding-left: 110px;
}

/* Ajustar hover para levar em conta o nível */
.nav-subitem[data-level="1"]:hover {
    padding-left: 74px;
}

.nav-subitem[data-level="2"]:hover {
    padding-left: 94px;
}

.nav-subitem[data-level="3"]:hover {
    padding-left: 114px;
}

.nav-subitem {
    padding: 10px 20px 10px 50px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.submenu .nav-subitem {
    padding-left: 50px;
}

.submenu-nested .nav-subitem {
    padding-left: 80px;
}

.nav-subitem:hover {
    color: var(--accent-gold);
    background-color: rgba(198, 183, 75, 0.1);
    border-left-color: var(--accent-blue);
    padding-left: 54px;
}

.nav-subitem.active {
    color: var(--accent-gold);
    background-color: rgba(198, 183, 75, 0.15);
    border-left-color: var(--accent-gold);
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.version {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Main Content */
main.main-content {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 30px;
    background-color: var(--secondary-dark);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top > div:nth-child(2) {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

#header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background-color: rgba(198, 183, 75, 0.1);
    transform: scale(1.05);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background-color: var(--accent-gold);
    transition: all var(--transition-fast);
    border-radius: 1px;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb-item {
    color: var(--accent-blue);
    cursor: default;
    transition: color var(--transition-fast);
}

.breadcrumb-item.breadcrumb-link {
    cursor: pointer;
    text-decoration: underline;
}

.breadcrumb-item.breadcrumb-link:hover {
    color: var(--accent-gold);
    text-decoration: underline wavy;
}

.breadcrumb-separator {
    color: var(--accent-blue);
    margin: 0 5px;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    animation: fadeIn var(--transition-normal);
}

.content-with-edit {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.content-body {
    flex: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-screen {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-secondary);
}

.welcome-screen h2 {
    font-size: 42px;
    color: var(--accent-gold);
    margin-bottom: 20px;
    background: linear-gradient(135deg, #c6b74b, #b46f38);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen p {
    font-size: 18px;
}

/* Content Styling */
.content-area h1 {
    font-size: 36px;
    color: var(--accent-gold);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 15px;
}

.content-area h2 {
    font-size: 28px;
    color: var(--accent-purple);
    margin-top: 30px;
    margin-bottom: 15px;
}

.content-area h3 {
    font-size: 22px;
    color: var(--accent-blue);
    margin-top: 25px;
    margin-bottom: 12px;
}

.content-area p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.content-area ul,
.content-area ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-area li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.content-area code {
    background-color: var(--highlight);
    color: var(--accent-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.content-area pre {
    background-color: var(--highlight);
    color: var(--accent-blue);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-gold);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.content-area blockquote {
    border-left: 4px solid var(--accent-purple);
    padding-left: 15px;
    margin: 15px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.content-area a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.content-area a:hover {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.content-area img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal);
}

.content-area img:hover {
    transform: scale(1.02);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background-color: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-gold);
    border-radius: 5px;
    transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-purple);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    main.main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .header-top {
        padding: 15px 20px;
    }

    .content-area {
        padding: 30px 20px;
    }

    .content-area h1 {
        font-size: 28px;
    }

    .content-area h2 {
        font-size: 22px;
    }

    .content-area h3 {
        font-size: 18px;
    }

    .logo {
        font-size: 22px;
    }

    .tagline {
        font-size: 11px;
    }

    .welcome-screen h2 {
        font-size: 32px;
    }

    .breadcrumb {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 220px;
    }

    .content-area {
        padding: 20px 15px;
    }

    .content-area h1 {
        font-size: 24px;
    }

    .nav-item {
        padding: 10px 15px;
    }

    .nav-subitem {
        padding: 8px 15px 8px 40px;
    }

    .header-top {
        padding: 12px 15px;
        gap: 15px;
    }

    .welcome-screen {
        padding: 40px 20px;
    }


    .welcome-screen h2 {
        font-size: 24px;
    }
}

.error-message {
    background-color: rgba(193, 18, 31, 0.1);
    border: 2px solid var(--accent-red);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: var(--accent-red);
}

.error-message h2 {
    color: var(--accent-red);
    margin-bottom: 15px;
}

.error-message p {
    color: var(--text-secondary);
}

/* Modal Editor */
.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
}

.editor-modal.hidden {
    display: none;
}

.editor-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.editor-modal-content {
    position: relative;
    background-color: var(--primary-dark);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.editor-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--secondary-dark);
    border-radius: 15px 15px 0px 0px;
}

.editor-modal-header h2 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 24px;
}

.editor-close-btn {
    background: none;
    border: none;
    color: var(--accent-gold);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.editor-close-btn:hover {
    color: var(--accent-purple);
    transform: scale(1.1);
}

.editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 10px;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px;
    background-color: var(--secondary-dark);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    margin-bottom: 10px;
    align-items: center;
}

.editor-toolbar-btn {
    padding: 8px 14px;
    background-color: var(--secondary-dark);
    color: white;
    border: 1px solid var(--highlight);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-theme-btn {
    padding: 8px 10px;
    background-color: transparent;
    color: var(--accent-gold);
    border: 1px solid #666666;
    font-size: 16px;
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-toolbar-btn:hover {
    background-color: var(--highlight);
   
}

.editor-toolbar-btn:active {
    transform: translateY(0);
}

.editor-theme-btn:hover {
    background-color: var(--highlight);
    color: var(--accent-purple);
}

.editor-theme-btn:active {
    transform: scale(0.95);
}

.editor-toast-ui {
    flex: 1;
    /* overflow: hidden; */
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Toast UI customization */
.editor-toast-ui .toastui-editor-defaultUI {
    border: none;
    border-radius: 8px;

    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    margin-bottom: 10px;
}

.editor-textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(198, 183, 75, 0.3);
}

.editor-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 5px;
}

.editor-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--highlight);
    overflow: hidden;
}

.editor-preview-header {
    padding: 10px 15px;
    background-color: var(--secondary-dark);
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.editor-preview {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    color: var(--text-primary);
}

.editor-preview h1 {
    font-size: 28px;
    color: var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 10px;
    margin: 15px 0;
}

.editor-preview h2 {
    font-size: 22px;
    color: var(--accent-purple);
    margin: 15px 0 10px 0;
}

.editor-preview h3 {
    font-size: 18px;
    color: var(--accent-blue);
    margin: 10px 0 8px 0;
}

.editor-preview p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.editor-preview ul,
.editor-preview ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.editor-preview li {
    margin-bottom: 5px;
}

.editor-preview code {
    background-color: rgba(198, 183, 75, 0.1);
    color: var(--accent-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.editor-preview pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    border-left: 3px solid var(--accent-gold);
    margin-bottom: 10px;
}

.editor-preview blockquote {
    border-left: 4px solid var(--accent-purple);
    padding-left: 15px;
    color: var(--text-secondary);
    font-style: italic;
    margin: 10px 0;
}

.editor-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--accent-gold);
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.editor-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--secondary-dark);
    border-radius: 0 0 15px 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #c6b74b, #b46f38);
    color: #1f1f1f;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--highlight);
}

.edit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #c6b74b, #b46f38);
    color: #1f1f1f;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.edit-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 183, 75, 0.3);
}

@media (max-width: 1024px) {
    .editor-container {
        flex-direction: column;
    }

    .editor-right {
        max-height: 300px;
    }

    .editor-modal-content {
        width: 95%;
        height: 90vh;
    }
}

/* Toast UI Dark Theme (Default - RockTale Style) */
.toastui-editor-dark {
    --toastui-editor-background-color: var(--primary-dark) !important;
    --toastui-editor-text-color: var(--text-primary) !important;
    --toastui-editor-border-color: var(--border-color) !important;
}

.toastui-editor-dark .toastui-editor-md-container,
.toastui-editor-dark .toastui-editor-preview {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
}

.toastui-editor-dark .toastui-editor-md-textarea,
.toastui-editor-dark .ProseMirror {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
    caret-color: var(--accent-gold);
}

.toastui-editor-dark .toastui-editor-toolbar {
    background-color: var(--secondary-dark) !important;
    border-color: var(--border-color) !important;
}

.toastui-editor-dark .toastui-editor-defaultUI-toolbar button {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

.toastui-editor-dark .toastui-editor-defaultUI-toolbar button:hover {
    background-color: var(--accent-purple) !important;
    color: var(--text-primary) !important;
}

/* Toast UI syntax highlighting for dark theme */
.toastui-editor-dark .toastui-editor-md-code {
    color: var(--accent-gold) !important;
}

.toastui-editor-dark .toastui-editor-md-strong {
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .toastui-editor-md-heading {
    color: var(--accent-gold) !important;
}

/* Toast UI Light Theme (Inverted) */
.toastui-editor-light {
    --toastui-editor-background-color: #f5f5f5 !important;
    --toastui-editor-text-color: #1a1a1a !important;
    --toastui-editor-border-color: #d0d0d0 !important;
    border-radius: 5px !important;
}

.toastui-editor-light .toastui-editor-md-container,
.toastui-editor-light .toastui-editor-preview {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

.toastui-editor-light .toastui-editor-md-textarea,
.toastui-editor-light .ProseMirror {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    caret-color: #d4a574;
}

.toastui-editor-light .toastui-editor-toolbar {
    background-color: #f5f5f5 !important;
    border-color: #d0d0d0 !important;
}

.toastui-editor-light .toastui-editor-defaultUI-toolbar button {
    color: #1a1a1a !important;
    background-color: transparent !important;
}

.toastui-editor-light .toastui-editor-defaultUI-toolbar button:hover {
    background-color: #b46f38 !important;
    color: #ffffff !important;
}

/* Toast UI syntax highlighting for light theme */
.toastui-editor-light .toastui-editor-md-code {
    color: #d4a574 !important;
}

.toastui-editor-light .toastui-editor-md-strong {
    color: #b46f38 !important;
}

.toastui-editor-light .toastui-editor-md-heading {
    color: #d4a574 !important;
}

/* Toast UI Light Theme - Background White for All Containers */
.toastui-editor[data-theme="light"],
.toastui-editor.toastui-editor-light {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-defaultUI,
.toastui-editor.toastui-editor-light .toastui-editor-defaultUI {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-md-container,
.toastui-editor.toastui-editor-light .toastui-editor-md-container {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-md-tab-contents,
.toastui-editor.toastui-editor-light .toastui-editor-md-tab-contents {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-mode,
.toastui-editor.toastui-editor-light .toastui-editor-mode {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-md-preview-container,
.toastui-editor.toastui-editor-light .toastui-editor-md-preview-container,
.toastui-editor[data-theme="light"] .toastui-editor-md-tab-container,
.toastui-editor.toastui-editor-light .toastui-editor-md-tab-container {
    background-color: #ffffff !important;
}

/* Extra specificity for editing areas in light mode */
.toastui-editor[data-theme="light"] .ProseMirror,
.toastui-editor.toastui-editor-light .ProseMirror {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-md-preview,
.toastui-editor.toastui-editor-light .toastui-editor-md-preview {
    background-color: #ffffff !important;
}

.toastui-editor[data-theme="light"] .toastui-editor-preview,
.toastui-editor.toastui-editor-light .toastui-editor-preview {
    background-color: #ffffff !important;
}

/* Light theme - Force white on all main containers */
#editor-toast-ui.toastui-editor[theme="light"] {
    background-color: #ffffff !important;
}

#editor-toast-ui {
    background-color: #ffffff !important;
}

#editor-toast-ui .toastui-editor-defaultUI {
    background-color: #ffffff !important;
}

#editor-toast-ui .toastui-editor-main {
    background-color: #ffffff !important;
}

#editor-toast-ui .toastui-editor-md-container,
#editor-toast-ui .toastui-editor-md-mode {
    background-color: #ffffff !important;
}

#editor-toast-ui .toastui-editor-md-preview,
#editor-toast-ui .toastui-editor-preview {
    background-color: #ffffff !important;
}

/* ========== DARK THEME - Ensure dark background ========== */
#editor-toast-ui.toastui-editor-dark,
#editor-toast-ui[theme="dark"] {
    background-color: var(--primary-dark) !important;
}

#editor-toast-ui.toastui-editor-dark .toastui-editor-defaultUI,
#editor-toast-ui[theme="dark"] .toastui-editor-defaultUI {
    background-color: var(--primary-dark) !important;
}

#editor-toast-ui.toastui-editor-dark .toastui-editor-md-container,
#editor-toast-ui[theme="dark"] .toastui-editor-md-container,
#editor-toast-ui.toastui-editor-dark .toastui-editor-md-mode,
#editor-toast-ui[theme="dark"] .toastui-editor-md-mode {
    background-color: var(--primary-dark) !important;
}

#editor-toast-ui.toastui-editor-dark .ProseMirror,
#editor-toast-ui[theme="dark"] .ProseMirror {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
}

#editor-toast-ui.toastui-editor-dark .toastui-editor-md-preview,
#editor-toast-ui[theme="dark"] .toastui-editor-md-preview,
#editor-toast-ui.toastui-editor-dark .toastui-editor-preview,
#editor-toast-ui[theme="dark"] .toastui-editor-preview {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
}

/* ========== LIGHT THEME - Ensure white background ========== */
#editor-toast-ui.toastui-editor-light,
#editor-toast-ui[theme="light"] {
    background-color: #ffffff !important;
}

#editor-toast-ui.toastui-editor-light .toastui-editor-defaultUI,
#editor-toast-ui[theme="light"] .toastui-editor-defaultUI {
    background-color: #ffffff !important;
}

#editor-toast-ui.toastui-editor-light .toastui-editor-md-container,
#editor-toast-ui[theme="light"] .toastui-editor-md-container,
#editor-toast-ui.toastui-editor-light .toastui-editor-md-mode,
#editor-toast-ui[theme="light"] .toastui-editor-md-mode {
    background-color: #ffffff !important;
}

#editor-toast-ui.toastui-editor-light .ProseMirror,
#editor-toast-ui[theme="light"] .ProseMirror {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

#editor-toast-ui.toastui-editor-light .toastui-editor-md-preview,
#editor-toast-ui[theme="light"] .toastui-editor-md-preview,
#editor-toast-ui.toastui-editor-light .toastui-editor-preview,
#editor-toast-ui[theme="light"] .toastui-editor-preview {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

#editor-toast-ui .ProseMirror {
    background-color: #ffffff !important;
}

/* ========== TOOLBAR - Always Light Styling (Independent of Theme) ========== */
#editor-toast-ui .toastui-editor-toolbar,
#editor-toast-ui .toastui-editor-toolbar-group {
    background-color: #f5f5f5 !important;
    color: #333333 !important;
}

#editor-toast-ui .toastui-editor-toolbar-item-wrapper,
#editor-toast-ui .toastui-editor-toolbar-divider,
#editor-toast-ui .toastui-editor-toolbar-group [class*="toastui-editor"] {
    background-color: transparent !important;
    color: inherit !important;
}

#editor-toast-ui .toastui-editor-toolbar button,
#editor-toast-ui .toastui-editor-toolbar label {
    background-color: transparent !important;
    color: #333333 !important;
}

#editor-toast-ui .toastui-editor-toolbar button:hover,
#editor-toast-ui .toastui-editor-toolbar label:hover {
    background-color: #e0e0e0 !important;
}

/* Toast UI WYSIWYG/Preview Area - Dark Theme */
.toastui-editor-dark .toastui-editor-ww-container {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
}

.toastui-editor-dark .toastui-editor-ww-container h1 {
    color: var(--accent-gold) !important;
    border-bottom: 2px solid var(--accent-gold) !important;
    padding-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-ww-container h2 {
    color: var(--accent-purple) !important;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-ww-container h3 {
    color: var(--accent-blue) !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
}

.toastui-editor-dark .toastui-editor-ww-container h4,
.toastui-editor-dark .toastui-editor-ww-container h5,
.toastui-editor-dark .toastui-editor-ww-container h6 {
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .toastui-editor-ww-container p {
    color: var(--text-primary) !important;
    line-height: 1.8 !important;
}

.toastui-editor-dark .toastui-editor-ww-container code {
    background-color: var(--highlight) !important;
    color: var(--accent-blue) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.toastui-editor-dark .toastui-editor-ww-container pre {
    background-color: var(--highlight) !important;
    color: var(--accent-blue) !important;
    border-left: 4px solid var(--accent-gold) !important;
    padding: 15px !important;
    border-radius: 8px !important;
}

.toastui-editor-dark .toastui-editor-ww-container a {
    color: var(--accent-purple) !important;
}

.toastui-editor-dark .toastui-editor-ww-container ul,
.toastui-editor-dark .toastui-editor-ww-container ol {
    margin-left: 20px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-ww-container li {
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
}

.toastui-editor-dark .toastui-editor-ww-container blockquote {
    border-left: 4px solid var(--accent-gold) !important;
    background-color: var(--highlight) !important;
    padding: 15px !important;
    color: var(--text-secondary) !important;
    border-radius: 4px !important;
}

.toastui-editor-dark .toastui-editor-ww-container strong {
    color: var(--accent-blue) !important;
    font-weight: 600 !important;
}

.toastui-editor-dark .toastui-editor-ww-container em {
    color: var(--accent-purple) !important;
}

/* Toast UI WYSIWYG/Preview Area - Light Theme */
.toastui-editor-light .toastui-editor-ww-container {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

.toastui-editor-light .toastui-editor-ww-container h1 {
    color: #d4a574 !important;
    border-bottom: 2px solid #d4a574 !important;
    padding-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-ww-container h2 {
    color: #b46f38 !important;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-ww-container h3 {
    color: #d4a574 !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
}

.toastui-editor-light .toastui-editor-ww-container h4,
.toastui-editor-light .toastui-editor-ww-container h5,
.toastui-editor-light .toastui-editor-ww-container h6 {
    color: #d4a574 !important;
}

.toastui-editor-light .toastui-editor-ww-container p {
    color: #1a1a1a !important;
    line-height: 1.8 !important;
}

.toastui-editor-light .toastui-editor-ww-container code {
    background-color: #efefef !important;
    color: #b46f38 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.toastui-editor-light .toastui-editor-ww-container pre {
    background-color: #efefef !important;
    color: #b46f38 !important;
    border-left: 4px solid #d4a574 !important;
    padding: 15px !important;
    border-radius: 8px !important;
}

.toastui-editor-light .toastui-editor-ww-container a {
    color: #b46f38 !important;
}

.toastui-editor-light .toastui-editor-ww-container ul,
.toastui-editor-light .toastui-editor-ww-container ol {
    margin-left: 20px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-ww-container li {
    color: #1a1a1a !important;
    margin-bottom: 8px !important;
}

.toastui-editor-light .toastui-editor-ww-container blockquote {
    border-left: 4px solid #d4a574 !important;
    background-color: #f5f5f5 !important;
    padding: 15px !important;
    color: #666666 !important;
    border-radius: 4px !important;
}

.toastui-editor-light .toastui-editor-ww-container strong {
    color: #b46f38 !important;
    font-weight: 600 !important;
}

.toastui-editor-light .toastui-editor-ww-container em {
    color: #b46f38 !important;
}

@media (max-width: 768px) {
    .editor-modal-content {
        width: 98%;
        height: 95vh;
    }

    .editor-textarea {
        font-size: 12px;
    }
}

/* Toast UI Editor - Markdown Syntax Highlighting (Dark Theme) */
.toastui-editor-dark .toastui-editor-md-heading {
    color: var(--accent-gold) !important;
}

.toastui-editor-dark .toastui-editor-md-strong,
.toastui-editor-dark .toastui-editor-md-code-block {
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .toastui-editor-md-list {
    color: var(--text-primary) !important;
}

.toastui-editor-dark .toastui-editor-md-link {
    color: var(--accent-purple) !important;
}

.toastui-editor-dark .toastui-editor-md-image {
    color: var(--accent-purple) !important;
}

/* WYSIWYG Visual Editor Mode - Dark Theme */
.toastui-editor-dark .ProseMirror {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
}

.toastui-editor-dark .ProseMirror h1 {
    color: var(--accent-gold) !important;
    border-bottom: 2px solid var(--accent-gold) !important;
    padding-bottom: 15px !important;
}

.toastui-editor-dark .ProseMirror h2 {
    color: var(--accent-purple) !important;
    margin-top: 30px !important;
}

.toastui-editor-dark .ProseMirror h3 {
    color: var(--accent-blue) !important;
    margin-top: 25px !important;
}

.toastui-editor-dark .ProseMirror code {
    background-color: var(--highlight) !important;
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .ProseMirror pre {
    background-color: var(--highlight) !important;
    border-left: 4px solid var(--accent-gold) !important;
}

.toastui-editor-dark .ProseMirror a {
    color: var(--accent-purple) !important;
}

.toastui-editor-dark .ProseMirror blockquote {
    border-left: 4px solid var(--accent-gold) !important;
    background-color: var(--highlight) !important;
}

/* WYSIWYG Visual Editor Mode - Light Theme */
.toastui-editor-light .ProseMirror {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

.toastui-editor-light .ProseMirror h1 {
    color: #d4a574 !important;
    border-bottom: 2px solid #d4a574 !important;
    padding-bottom: 15px !important;
}

.toastui-editor-light .ProseMirror h2 {
    color: #b46f38 !important;
    margin-top: 30px !important;
}

.toastui-editor-light .ProseMirror h3 {
    color: #d4a574 !important;
    margin-top: 25px !important;
}

.toastui-editor-light .ProseMirror code {
    background-color: #efefef !important;
    color: #b46f38 !important;
}

.toastui-editor-light .ProseMirror pre {
    background-color: #efefef !important;
    border-left: 4px solid #d4a574 !important;
}

.toastui-editor-light .ProseMirror a {
    color: #b46f38 !important;
}

.toastui-editor-light .ProseMirror blockquote {
    border-left: 4px solid #d4a574 !important;
    background-color: #f5f5f5 !important;
}

/* Preview pane dark theme */
.toastui-editor-dark .toastui-editor-preview h1 {
    color: var(--accent-gold) !important;
    border-bottom-color: var(--accent-gold) !important;
}

.toastui-editor-dark .toastui-editor-preview h2 {
    color: var(--accent-purple) !important;
}

.toastui-editor-dark .toastui-editor-preview h3 {
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .toastui-editor-preview code,
.toastui-editor-dark .toastui-editor-preview pre {
    background-color: var(--highlight) !important;
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .toastui-editor-preview pre {
    border-left: 4px solid var(--accent-gold) !important;
}

/* Toast UI Editor - Light Theme */
.toastui-editor-light .toastui-editor-md-heading {
    color: #d4a574 !important;
}

.toastui-editor-light .toastui-editor-md-strong,
.toastui-editor-light .toastui-editor-md-code-block {
    color: #b46f38 !important;
}

.toastui-editor-light .toastui-editor-md-list {
    color: #1a1a1a !important;
}

.toastui-editor-light .toastui-editor-md-link {
    color: #b46f38 !important;
}

.toastui-editor-light .toastui-editor-md-image {
    color: #b46f38 !important;
}

/* Preview pane dark theme - Complete Formatting */
.toastui-editor-dark .toastui-editor-preview,
.toastui-editor-dark .toastui-editor-md-preview {
    background-color: var(--primary-dark) !important;
    color: var(--text-primary) !important;
}

.toastui-editor-dark .toastui-editor-preview h1,
.toastui-editor-dark .toastui-editor-md-preview h1 {
    color: var(--accent-gold) !important;
    border-bottom: 2px solid var(--accent-gold) !important;
    padding-bottom: 15px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

.toastui-editor-dark .toastui-editor-preview h2,
.toastui-editor-dark .toastui-editor-md-preview h2 {
    color: var(--accent-purple) !important;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-preview h3,
.toastui-editor-dark .toastui-editor-md-preview h3 {
    color: var(--accent-blue) !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
}

.toastui-editor-dark .toastui-editor-preview h4,
.toastui-editor-dark .toastui-editor-preview h5,
.toastui-editor-dark .toastui-editor-preview h6,
.toastui-editor-dark .toastui-editor-md-preview h4,
.toastui-editor-dark .toastui-editor-md-preview h5,
.toastui-editor-dark .toastui-editor-md-preview h6 {
    color: var(--accent-blue) !important;
}

.toastui-editor-dark .toastui-editor-preview p,
.toastui-editor-dark .toastui-editor-md-preview p {
    color: var(--text-primary) !important;
    margin-bottom: 15px !important;
    line-height: 1.8 !important;
}

.toastui-editor-dark .toastui-editor-preview code,
.toastui-editor-dark .toastui-editor-md-preview code {
    background-color: var(--highlight) !important;
    color: var(--accent-blue) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 13px !important;
}

.toastui-editor-dark .toastui-editor-preview pre,
.toastui-editor-dark .toastui-editor-md-preview pre {
    background-color: var(--highlight) !important;
    color: var(--accent-blue) !important;
    padding: 15px !important;
    border-radius: 8px !important;
    border-left: 4px solid var(--accent-gold) !important;
    margin-bottom: 15px !important;
    overflow-x: auto !important;
    font-family: 'Courier New', monospace !important;
}

.toastui-editor-dark .toastui-editor-preview a,
.toastui-editor-dark .toastui-editor-md-preview a {
    color: var(--accent-purple) !important;
    text-decoration: none !important;
}

.toastui-editor-dark .toastui-editor-preview a:hover,
.toastui-editor-dark .toastui-editor-md-preview a:hover {
    text-decoration: underline !important;
}

.toastui-editor-dark .toastui-editor-preview ul,
.toastui-editor-dark .toastui-editor-preview ol,
.toastui-editor-dark .toastui-editor-md-preview ul,
.toastui-editor-dark .toastui-editor-md-preview ol {
    margin-left: 20px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-preview li,
.toastui-editor-dark .toastui-editor-md-preview li {
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
}

.toastui-editor-dark .toastui-editor-preview blockquote,
.toastui-editor-dark .toastui-editor-md-preview blockquote {
    border-left: 4px solid var(--accent-gold) !important;
    background-color: var(--highlight) !important;
    padding: 15px !important;
    color: var(--text-secondary) !important;
    border-radius: 4px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-preview strong,
.toastui-editor-dark .toastui-editor-md-preview strong {
    color: var(--accent-blue) !important;
    font-weight: 600 !important;
}

.toastui-editor-dark .toastui-editor-preview em {
    color: var(--accent-purple) !important;
}

.toastui-editor-dark .toastui-editor-preview img {
    max-width: 100% !important;
    border-radius: 8px !important;
    margin: 15px 0 !important;
}

.toastui-editor-dark .toastui-editor-preview table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 15px !important;
}

.toastui-editor-dark .toastui-editor-preview table th,
.toastui-editor-dark .toastui-editor-preview table td {
    border: 1px solid var(--border-color) !important;
    padding: 10px !important;
    text-align: left !important;
}

.toastui-editor-dark .toastui-editor-preview table th {
    background-color: var(--highlight) !important;
    color: var(--accent-gold) !important;
}

.toastui-editor-dark .toastui-editor-preview hr {
    border: none !important;
    border-top: 2px solid var(--border-color) !important;
    margin: 20px 0 !important;
}

/* Preview pane light theme - Complete Formatting */
.toastui-editor-light .toastui-editor-preview,
.toastui-editor-light .toastui-editor-md-preview {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

.toastui-editor-light .toastui-editor-preview h1,
.toastui-editor-light .toastui-editor-md-preview h1 {
    color: #d4a574 !important;
    border-bottom: 2px solid #d4a574 !important;
    padding-bottom: 15px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

.toastui-editor-light .toastui-editor-preview h2,
.toastui-editor-light .toastui-editor-md-preview h2 {
    color: #b46f38 !important;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-preview h3,
.toastui-editor-light .toastui-editor-md-preview h3 {
    color: #d4a574 !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
}

.toastui-editor-light .toastui-editor-preview h4,
.toastui-editor-light .toastui-editor-preview h5,
.toastui-editor-light .toastui-editor-preview h6,
.toastui-editor-light .toastui-editor-md-preview h4,
.toastui-editor-light .toastui-editor-md-preview h5,
.toastui-editor-light .toastui-editor-md-preview h6 {
    color: #d4a574 !important;
}

.toastui-editor-light .toastui-editor-preview p,
.toastui-editor-light .toastui-editor-md-preview p {
    color: #1a1a1a !important;
    margin-bottom: 15px !important;
    line-height: 1.8 !important;
}

.toastui-editor-light .toastui-editor-preview code,
.toastui-editor-light .toastui-editor-md-preview code {
    background-color: #efefef !important;
    color: #b46f38 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 13px !important;
}

.toastui-editor-light .toastui-editor-preview pre,
.toastui-editor-light .toastui-editor-md-preview pre {
    background-color: #efefef !important;
    color: #b46f38 !important;
    padding: 15px !important;
    border-radius: 8px !important;
    border-left: 4px solid #d4a574 !important;
    margin-bottom: 15px !important;
    overflow-x: auto !important;
    font-family: 'Courier New', monospace !important;
}

.toastui-editor-light .toastui-editor-preview a,
.toastui-editor-light .toastui-editor-md-preview a {
    color: #b46f38 !important;
    text-decoration: none !important;
}

.toastui-editor-light .toastui-editor-preview a:hover,
.toastui-editor-light .toastui-editor-md-preview a:hover {
    text-decoration: underline !important;
}

.toastui-editor-light .toastui-editor-preview ul,
.toastui-editor-light .toastui-editor-preview ol,
.toastui-editor-light .toastui-editor-md-preview ul,
.toastui-editor-light .toastui-editor-md-preview ol {
    margin-left: 20px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-preview li,
.toastui-editor-light .toastui-editor-md-preview li {
    color: #1a1a1a !important;
    margin-bottom: 8px !important;
}

.toastui-editor-light .toastui-editor-preview blockquote,
.toastui-editor-light .toastui-editor-md-preview blockquote {
    border-left: 4px solid #d4a574 !important;
    background-color: #f5f5f5 !important;
    padding: 15px !important;
    color: #666666 !important;
    border-radius: 4px !important;
    margin-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-preview strong,
.toastui-editor-light .toastui-editor-md-preview strong {
    color: #b46f38 !important;
    font-weight: 600 !important;
}

.toastui-editor-light .toastui-editor-preview em,
.toastui-editor-light .toastui-editor-md-preview em {
    color: #b46f38 !important;
}

.toastui-editor-light .toastui-editor-preview img,
.toastui-editor-light .toastui-editor-md-preview img {
    max-width: 100% !important;
    border-radius: 8px !important;
    margin: 15px 0 !important;
}

.toastui-editor-light .toastui-editor-preview table,
.toastui-editor-light .toastui-editor-md-preview table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 15px !important;
}

.toastui-editor-light .toastui-editor-preview table th,
.toastui-editor-light .toastui-editor-preview table td,
.toastui-editor-light .toastui-editor-md-preview table th,
.toastui-editor-light .toastui-editor-md-preview table td {
    border: 1px solid #d0d0d0 !important;
    padding: 10px !important;
    text-align: left !important;
}

.toastui-editor-light .toastui-editor-preview table th,
.toastui-editor-light .toastui-editor-md-preview table th {
    background-color: #f5f5f5 !important;
    color: #d4a574 !important;
}

.toastui-editor-light .toastui-editor-preview hr,
.toastui-editor-light .toastui-editor-md-preview hr {
    border: none !important;
    border-top: 2px solid #d0d0d0 !important;
    margin: 20px 0 !important;
}

/* ===== LOGIN MODAL SIMPLES ===== */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.login-container.hidden {
    display: none;
}

.login-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    pointer-events: auto;
}

.login-box {
    position: relative;
    z-index: 10001;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    border: 2px solid #c6b74b;
    border-radius: 10px;
    padding: 40px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    text-align: center;
    pointer-events: auto;
}

.login-box h2 {
    margin: 0 0 10px 0;
    color: #c6b74b;
    font-size: 24px;
    font-weight: 600;
}

.login-box p {
    margin: 0 0 25px 0;
    color: #aaa;
    font-size: 14px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-input {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #c6b74b;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s;
}

#login-input:focus {
    outline: none;
    background: rgba(198, 183, 75, 0.15);
    box-shadow: 0 0 10px rgba(198, 183, 75, 0.3);
}

#login-input::placeholder {
    color: #999;
}

#login-form button {
    padding: 12px;
    background: linear-gradient(135deg, #c6b74b, #b46f38);
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    pointer-events: auto;
}

#login-form button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(198, 183, 75, 0.3);
}

#login-form button:active {
    transform: translateY(0);
}

.login-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-password-wrapper input {
    flex: 1;
    padding-right: 40px;
}

.toggle-password-btn {

    position: absolute;
    right: 12px;
    background: none !important;
    border: none;
    cursor: pointer;
    padding: 1px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.toggle-password-btn:hover {
    opacity: 1;
    transform: none !important;
    box-shadow: 0 2px 5px rgba(180, 180, 180, 0.3) !important;
}

.toggle-password-btn:active {
    transform: scale(0.95);
}

.toggle-password-btn .eye-icon {
    font-size: 16px;
    user-select: none;
}

.login-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 2px solid #ff6b6b;
    border-radius: 3px;
    text-align: left;
}

.login-error.hidden {
    display: none;
}


/* ========== GALERIA MODAL - RockTale Style ========== */

.galeria-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(198, 183, 75, 0.05);
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
}

.galeria-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 12;
    max-height: 200px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--accent-gold);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.galeria-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(198, 183, 75, 0.4);
    border-color: var(--accent-blue);
}

/* Modal da Galeria */
.galeria-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.galeria-modal.active {
    display: flex;
}

.galeria-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.galeria-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(198, 183, 75, 0.3);
}

.galeria-modal-counter {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
}

.galeria-modal-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
}

.galeria-btn {
    background-color: var(--accent-gold);
    border: none;
    color: var(--primary-dark);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all var(--transition-normal);
}

.galeria-btn:hover {
    background-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(198, 183, 75, 0.3);
}

.galeria-btn:active {
    transform: translateY(0);
}

.galeria-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.galeria-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--accent-gold);
    border: none;
    color: var(--primary-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    font-weight: bold;
}

.galeria-close-btn:hover {
    background-color: var(--accent-blue);
    transform: rotate(90deg);
}

/* Responsivo */
@media (max-width: 1400px) {
    .galeria-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 1024px) {
    .galeria-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .content-area {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .galeria-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
        margin: 15px 0;
    }

    .galeria-modal-buttons {
        flex-direction: column;
        width: 90%;
        gap: 10px;
    }

    .galeria-btn {
        width: 100%;
    }

    .galeria-close-btn {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .galeria-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        padding: 10px;
    }

    .galeria-modal-image {
        max-height: 70vh;
    }

    .content-area {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .galeria-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
        margin: 10px 0;
    }

    .galeria-modal-content {
        max-width: 98vw;
        padding: 5px;
    }

    .galeria-modal-image {
        max-height: 60vh;
    }

    .galeria-close-btn {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .galeria-modal-counter {
        font-size: 12px;
        margin-top: 10px;
    }

    .galeria-btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    .content-area {
        padding: 15px 10px;
    }
}
