/* Các component dùng chung */

/* Dialog boxes */
.dialog {
    position: absolute;
    background: var(--win95-gray);
    border: var(--border-raised);
    min-width: 250px;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dialog-titlebar {
    height: 18px;
    background: linear-gradient(90deg, var(--win95-blue) 0%, #1084d0 100%);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-size: 11px;
    font-weight: bold;
}

.dialog-content {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dialog-icon {
    width: 32px;
    height: 32px;
}

.dialog-message {
    flex: 1;
    font-size: 11px;
}

.dialog-buttons {
    padding: 8px 16px 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Input controls */
.textbox {
    background: white;
    border: var(--border-sunken);
    padding: 2px 4px;
    font-family: inherit;
    font-size: inherit;
}

.textbox:focus {
    outline: none;
}

.checkbox {
    width: 13px;
    height: 13px;
    background: white;
    border: var(--border-sunken);
    cursor: pointer;
    position: relative;
}

.checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    font-size: 10px;
    font-weight: bold;
}

.radio {
    width: 13px;
    height: 13px;
    background: white;
    border: var(--border-sunken);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
}

.radio.checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 5px;
    height: 5px;
    background: black;
    border-radius: 50%;
}

/* Dropdown */
.dropdown {
    background: white;
    border: var(--border-sunken);
    padding: 2px 20px 2px 4px;
    cursor: pointer;
    position: relative;
    min-width: 100px;
}

.dropdown::after {
    content: '▼';
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 8px;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background: white;
    border: var(--border-raised);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.dropdown.open .dropdown-list {
    display: block;
}

.dropdown-item {
    padding: 2px 4px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--win95-blue);
    color: white;
}

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

::-webkit-scrollbar-track {
    background: var(--win95-gray);
    border: var(--border-sunken);
}

::-webkit-scrollbar-thumb {
    background: var(--win95-gray);
    border: var(--border-raised);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--win95-light-gray);
}

::-webkit-scrollbar-corner {
    background: var(--win95-gray);
}

/* Progress bar */
.progress-bar {
    height: 20px;
    background: white;
    border: var(--border-sunken);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--win95-blue);
    transition: width 0.3s ease;
}

/* Tabs */
.tab-container {
    border-bottom: 1px solid var(--win95-dark-gray);
}

.tab-header {
    display: flex;
    background: var(--win95-gray);
}

.tab-button {
    padding: 4px 12px;
    background: var(--win95-gray);
    border: var(--border-raised);
    border-bottom: none;
    cursor: pointer;
    margin-right: 2px;
}

.tab-button.active {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.tab-content {
    background: white;
    padding: 8px;
    min-height: 200px;
}
/* 
Context Menu Styles */
.context-menu {
    position: fixed;
    background: var(--win95-gray);
    border: var(--border-raised);
    min-width: 150px;
    z-index: 10000;
    font-size: 11px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.context-submenu {
    position: fixed;
    background: var(--win95-gray);
    border: var(--border-raised);
    min-width: 120px;
    z-index: 10001;
    font-size: 11px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.menu-item:hover:not(.disabled) {
    background: var(--win95-blue);
    color: white;
}

.menu-item.disabled {
    color: var(--win95-dark-gray);
    cursor: default;
}

.menu-item.checked::before {
    content: '✓';
    position: absolute;
    left: 4px;
    font-weight: bold;
}

.menu-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    margin-right: 8px;
}

.menu-shortcut {
    color: var(--win95-dark-gray);
    font-size: 10px;
    margin-left: auto;
}

.menu-item:hover:not(.disabled) .menu-shortcut {
    color: white;
}

.menu-arrow {
    margin-left: auto;
    font-size: 8px;
}

.menu-separator {
    height: 1px;
    background: var(--win95-dark-gray);
    margin: 2px 4px;
    border-top: 1px solid var(--win95-light-gray);
}

/* Enhanced tab styles for properties dialogs */
.tab-container .tab {
    padding: 6px 12px;
    background: var(--win95-gray);
    border: 1px solid var(--win95-dark-gray);
    border-bottom: none;
    cursor: pointer;
    margin-right: 2px;
    display: inline-block;
}

.tab-container .tab.active {
    background: white;
    border-bottom: 1px solid white;
    position: relative;
    z-index: 1;
}

.tab-container .tab:hover:not(.active) {
    background: var(--win95-light-gray);
}

.tab-container + .tab-content {
    padding: 8px 0;
}