/* Reset & Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: #0c0c12;
    color: #ddd;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    overflow: hidden;
}

/* Slim Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 114, 255, 0.3);
}

/* 2-Column Split Layout */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    width: 280px;
    min-width: 280px;
    height: 100%;
    background: #14141c;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.app-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.app-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: radial-gradient(circle at top left, #12121a, #0c0c12);
}

.app-footer {
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    color: #444;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: #0c0c12;
}

/* User Info Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-card {
    background: rgba(25, 25, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.modal-close-btn:hover {
    color: #fff;
}
.modal-user-header {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}
#modal-user-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0072ff;
}
.modal-level-badge {
    position: absolute;
    bottom: -5px;
    background: #0072ff;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    border: 2px solid #191923;
}
.modal-user-body {
    text-align: center;
}
.modal-user-body h3 {
    color: #fff;
    margin-bottom: 4px;
}
.modal-user-sub {
    color: #888;
    font-size: 13px;
    margin-bottom: 20px;
}
.modal-user-details {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.detail-label {
    color: #666;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.detail-val {
    color: #ccc;
    font-size: 13px;
}
.modal-xp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-xp-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.modal-xp-progress {
    height: 100%;
    background: linear-gradient(90deg, #0072ff, #00c6ff);
    border-radius: 3px;
}
.modal-xp-text {
    font-size: 11px;
    color: #aaa;
    font-family: monospace;
}
.modal-user-actions {
    margin-top: 15px;
}

/* Quick Message Form inside Modal */
.quick-msg-form {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
    text-align: left;
}
.quick-msg-form textarea {
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    font-size: 12px;
    resize: none;
    margin-bottom: 10px;
}
.quick-msg-form textarea:focus {
    outline: none;
    border-color: #0072ff;
}
.quick-msg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Image alignment settings for rich text body */
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: inline-block;
    transition: transform 0.2s ease;
}
.ql-editor img:hover {
    box-shadow: 0 4px 20px rgba(0, 114, 255, 0.2);
}
.ql-editor img.align-left {
    float: left;
    margin-right: 20px;
}
.ql-editor img.align-right {
    float: right;
    margin-left: 20px;
}
.ql-editor img.align-center {
    display: block;
    margin: 10px auto;
}
.ql-editor p {
    margin-bottom: 0.4em;
    line-height: 1.45;
}
/* Line height variations for custom spacing option */
.ql-editor.lh-compact p {
    margin-bottom: 0.25em !important;
    line-height: 1.3 !important;
}
.ql-editor.lh-normal p {
    margin-bottom: 0.4em !important;
    line-height: 1.45 !important;
}
.ql-editor.lh-wide p {
    margin-bottom: 0.8em !important;
    line-height: 1.8 !important;
}

/* Quill Tooltip (Link Input pop-up) Dark Theme styling & boundary fix */
.ql-snow .ql-tooltip {
    background-color: #1c1c24 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    color: #eee !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    z-index: 1000 !important;
}
.ql-snow .ql-tooltip input[type=text] {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    outline: none !important;
    width: 170px !important;
}
.ql-snow .ql-tooltip input[type=text]:focus {
    border-color: #0072ff !important;
    box-shadow: 0 0 0 2px rgba(0, 114, 255, 0.25) !important;
}
.ql-snow .ql-tooltip a.ql-action::after {
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}
.ql-snow .ql-tooltip a.ql-action {
    color: #00c6ff !important;
    font-weight: 600 !important;
}
.ql-snow .ql-tooltip a.ql-remove {
    color: #ff3366 !important;
    margin-left: 8px !important;
}

.ql-editor a {
    color: #00c6ff;
    text-decoration: underline;
}
.ql-editor a:hover {
    color: #0072ff;
}
.ql-editor blockquote {
    clear: both;
    border-left: 4px solid #0072ff;
    padding-left: 15px;
    color: #aaa;
    font-style: italic;
    margin: 1.5em 0;
}
.ql-editor pre, .ql-editor .ql-syntax, .ql-editor .ql-code-block-container {
    clear: both !important;
    overflow-x: auto !important;
    background: #151520 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    color: #ffb74d !important;
    font-family: monospace !important;
    white-space: pre-wrap !important;
}
.ql-editor .ql-code-block {
    background: transparent !important;
    color: #ffb74d !important;
    font-family: monospace !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    white-space: pre-wrap !important;
}
.ql-editor code {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffb74d !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: monospace !important;
    font-size: 0.9em !important;
}
.ql-editor h1, .ql-editor h2, .ql-editor h3, .ql-editor h4, .ql-editor h5, .ql-editor h6 {
    clear: both;
}

.auth-full-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #12121a, #0c0c12);
    overflow-y: auto;
}

.btn-danger {
    background: rgba(244, 67, 54, 0.15) !important;
    border: 1px solid rgba(244, 67, 54, 0.25) !important;
    color: #ff5252 !important;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-danger:hover {
    background: #f44336 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3) !important;
}

/* Global Select & Dropdown Option Styling to fix white-on-white text */
select.form-control option, select option, .form-control option {
    background-color: #14141c !important;
    color: #fff !important;
}

/* Quill Image Resizer Overlay Styles */
.quill-image-resizer-overlay {
    transition: none !important;
}
.quill-image-resizer-handle {
    transition: transform 0.1s ease, background-color 0.2s ease;
}
.quill-image-resizer-handle:hover {
    transform: scale(1.3);
    background-color: #00c6ff !important;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: rgba(20, 20, 28, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: 10001;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 0;
}
.sidebar-toggle-btn:hover {
    background: rgba(30, 30, 42, 0.95);
    border-color: #0072ff;
}
.toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* Enable Hamburger Toggle Button */
    .sidebar-toggle-btn {
        display: flex;
    }

    /* Fixed Sidebar (Slide-out menu) */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Hide outside the viewport */
        z-index: 10000;
        height: 100%;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.6);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .app-sidebar.active {
        left: 0; /* Slide in */
    }

    /* Content Area spans full width */
    .app-layout {
        width: 100%;
        height: 100%;
    }
    .app-content-wrapper {
        width: 100%;
        min-width: 0;
        flex: none;
    }
    .app-main-content {
        padding: 70px 15px 30px 15px; /* Leave space at top for floating toggle button */
        -webkit-overflow-scrolling: touch;
    }
    
    /* UI components optimization for mobile */
    .home-intro-card, .dashboard-grid, .detail-card, .list-card, .admin-container {
        padding: 18px 15px !important;
        border-radius: 12px !important;
    }
    
    /* Fix potential text/layout overflows on mobile devices */
    h1, h2, h3 {
        word-break: keep-all;
    }
}