:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #333333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent-color: #007fd4;
    --accent-hover: #0060a0;
    --border-color: #3e3e42;
    --success-color: #4ec9b0;
    --warning-color: #ce9178;
    --header-height: 60px;
    --tab-height: 35px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    /* App-like feel */
    height: 100vh;
}

#root {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--success-color);
}

.actions-area {
    display: flex;
    gap: 10px;
}

.btn {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    background-color: #444;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

/* Layout */
.workspace {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Title Input in Header */
.title-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    width: 300px;
    transition: all 0.2s;
}

.title-input:hover {
    border-color: #555;
    background: rgba(255, 255, 255, 0.05);
}

.title-input:focus {
    border-color: var(--accent-color);
    background: var(--bg-primary);
    outline: none;
}

.title-input::placeholder {
    color: #666;
    font-weight: 400;
}

.editors-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    min-width: 300px;
}

.preview-pane {
    flex: 1;
    background-color: white;
    position: relative;
    min-width: 300px;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #fff;
}

/* Tabs */
.tabs-header {
    display: flex;
    height: var(--tab-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 0 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-right: 1px solid var(--border-color);
    outline: none;
}

.tab-btn:hover {
    color: var(--text-primary);
}

/* Hamburger Menu */
.menu-container {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

.menu-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    width: 240px;
    background-color: #252526;
    border: 1px solid #454545;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 5px 0;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cccccc;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.95rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: #094771;
    color: white;
}

.dropdown-item i {
    width: 25px;
    text-align: center;
    margin-right: 12px;
    color: var(--text-secondary);
}

.dropdown-item:hover i {
    color: white;
}

.dropdown-divider {
    height: 1px;
    background-color: #3e3e42;
    margin: 5px 0;
}

.menu-label {
    padding: 10px 20px 5px;
    font-size: 0.8rem;
    color: #888;
    font-weight: 600;
}

.sample-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    padding: 5px 15px 15px;
}

.sample-btn-small {
    background: #3e3e42;
    border: 1px solid transparent;
    color: #ccc;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sample-btn-small:hover {
    background: #094771;
    color: white;
    transform: translateY(-2px);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #ffffff;
    /* White background for better visibility */
    width: 600px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    color: #333;
    /* Dark text */
    animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #f8f9fa;
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

.modal-body {
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
}

.close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-item {
    padding: 15px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: background 0.1s;
}

.project-item:hover {
    background: #f1f8ff;
    /* Light blue hover */
}

.project-item:active {
    background: #e1f0fa;
}

.project-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #222;
    font-weight: 600;
}

.project-info .meta {
    font-size: 0.85rem;
    color: #777;
    display: flex;
    gap: 10px;
    align-items: center;
}

.project-arrow {
    color: #ccc;
}

.project-item:hover .project-arrow {
    color: #007fd4;
}

/* Title Input in Header */
.title-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    width: 300px;
    transition: all 0.2s;
}

.title-input:hover {
    border-color: #555;
    background: rgba(255, 255, 255, 0.05);
}

.title-input:focus {
    border-color: var(--accent-color);
    background: var(--bg-primary);
    outline: none;
}

.title-input::placeholder {
    color: #666;
    font-weight: 400;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    margin-left: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.editors-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    min-width: 300px;
}

.preview-pane {
    flex: 1;
    background-color: white;
    position: relative;
    min-width: 300px;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #fff;
}

/* Tabs */
.tabs-header {
    display: flex;
    height: var(--tab-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 0 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-right: 1px solid var(--border-color);
    outline: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: #2d2d2d;
}

.tab-btn.active {
    background-color: var(--bg-primary);
    color: var(--accent-color);
    border-top: 2px solid var(--accent-color);
    /* Highlight */
    font-weight: 600;
}

/* Editor Container */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100% - var(--tab-height));
    /* Subtract tab height */
    position: relative;
}

.monaco-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.hidden {
    display: none !important;
}