/* VSCode-Inspired Dark Theme Styles */

:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --bg-hover:rgb(72, 74, 74);
    --bg-active: #094771;
    --bg-selected: #37373d;
    
    --text-primary: #cccccc;
    --text-secondary: #858585;
    --text-disabled: #6a6a6a;
    
    --border-color: #3e3e42;
    --accent-color: #007acc;
    --accent-hover: #1a8cd8;
    
    --sidebar-width: 280px;
    --header-height: 30px;
    
    --transition-speed: 0.2s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header Row */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
}

.app-menu {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
}

.app-menu-right {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
    margin-left: auto;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-speed);
    border-radius: 4px;
    margin: 0 2px;
}

.menu-item:hover {
    background-color: var(--bg-hover);
}

.menu-item.active {
    background-color: var(--bg-hover);
}

.menu-item i {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-top: 2px;
    padding: 4px 0;
}

.menu-item.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color var(--transition-speed);
    user-select: none;
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
}

.dropdown-item i.fa-chevron-right {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: auto;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* Submenu */
.dropdown-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    margin-left: -2px; /* Negative margin to create a bridge, preventing gap */
    padding: 4px 0;
}

/* Ensure submenu doesn't go off screen */
.dropdown-submenu {
    max-height: 400px;
    overflow-y: auto;
}

/* Keep submenu open when hovering over parent item OR the submenu itself */
.dropdown-item:hover > .dropdown-submenu,
.dropdown-submenu:hover {
    display: block;
}

/* Keep parent item highlighted when hovering over submenu */
.dropdown-item:has(.dropdown-submenu:hover) {
    background-color: var(--bg-hover);
}

.color-picker-inline {
    margin-left: auto;
    width: 30px;
    height: 20px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-picker-inline::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-inline::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.dropdown-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.dropdown-item a:hover {
    text-decoration: underline;
}

/* Content Row: Nav and Main Content */
.content-row {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    transition: width var(--transition-speed);
}

.sidebar.collapsed {
    width: 0 !important;
    min-width: 0;
    overflow: visible;
}

.sidebar.collapsed .sidebar-nav {
    display: none;
}

.sidebar-toggle {
    position: absolute;
    top: 7px;
    right: -4px;
    width: 20px;
    height: 40px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color); 
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.sidebar-toggle:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle {
    right: -16px;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-icon-mobile {
    display: none !important;
}

.sidebar-icon-desktop {
    display: block;
}

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
    background: transparent;
}

.sidebar-resize-handle:hover {
    background-color: var(--accent-color);
    opacity: 0.5;
}

.sidebar.collapsed .sidebar-resize-handle {
    display: none;
}

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

.sidebar-nav::-webkit-scrollbar {
    width: 10px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Category Styles */
.nav-category {
    margin-bottom: 2px;
}

#favorites-category {
    display: none !important;
}

#favorites-category.has-favorites {
    display: block !important;
}

.category-header {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    user-select: none;
    transition: background-color var(--transition-speed);
}

.category-header:hover {
    background-color: var(--bg-hover);
}

.category-header i.category-icon {
    font-size: 10px;
    transition: transform var(--transition-speed);
    color: var(--text-secondary);
}

.category-header.expanded i.category-icon {
    transform: rotate(90deg);
}

.category-header i:not(.category-icon) {
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

.category-items {
    display: none;
    padding-left: 0;
}

.category-items.expanded {
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px 6px 35px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--bg-selected);
    color: var(--text-primary);
    border-left-color: var(--accent-color);
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.nav-item.active i {
    color: var(--accent-color);
}

.coming-soon-icon {
    position: absolute;
    right: 10px;
    width: auto !important;
    font-size: 10px !important;
    color: var(--text-disabled) !important;
    opacity: 0.6;
}

.nav-item[data-coming-soon="true"] {
    opacity: 0.8;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.content-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    flex-shrink: 0;
}

.content-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    position: relative;
}

.content-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-body::-webkit-scrollbar {
    width: 12px;
}

.content-body::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.content-body::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.content-body::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 64px;
    color: var(--accent-color);
    margin-bottom: 20px;
    opacity: 0.7;
}

.welcome-screen h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.welcome-screen p {
    font-size: 14px;
    max-width: 500px;
}

/* Tool Container Styles */
.tool-container {
    animation: fadeIn 0.3s ease-in;
}

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

.tool-section {
    margin-bottom: 25px;
}

.tool-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.tool-input-group {
    margin-bottom: 15px;
}

.tool-input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.tool-input-group textarea,
.tool-input-group input[type="text"],
.tool-input-group input[type="number"],
.tool-input-group select {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: border-color var(--transition-speed);
}

.tool-input-group textarea {
    min-height: 150px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.tool-input-group textarea:focus,
.tool-input-group input:focus,
.tool-input-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.tool-input-group textarea::placeholder,
.tool-input-group input::placeholder {
    color: var(--text-disabled);
}

.tool-button {
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    margin-right: 10px;
    margin-bottom: 10px;
}

.tool-button:hover {
    background-color: var(--accent-hover);
}

.tool-button:active {
    transform: scale(0.98);
}

.tool-button.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.tool-button.secondary:hover {
    background-color: var(--bg-hover);
}

.tool-output {
    margin-top: 15px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 100px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
}

.tool-output.empty {
    color: var(--text-disabled);
    font-style: italic;
}

.tool-info {
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-row {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar.collapsed {
        width: 100% !important;
        height: 0 !important;
        min-height: 0;
        max-height: 0;
        overflow: visible;
        border-bottom: none;
        position: relative;
    }
    
    .sidebar-nav {
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .nav-category {
        width: 100%;
    }
    
    .category-items {
        display: none;
    }
    
    .category-items.expanded {
        display: flex;
        flex-direction: column;
    }
    
    .nav-item {
        width: 100%;
        padding: 8px 15px 8px 35px;
    }
    
    .main-content {
        flex: 1;
    }
    
    .sidebar-toggle {
        top: auto;
        bottom: -4px;
        right: 10px;
        width: 40px;
        height: 20px;
    }
    
    .sidebar.collapsed .sidebar-toggle {
        bottom: -18px;
        right: 10px;
        z-index: 1000;
    }
    
    .sidebar-icon-desktop {
        display: none !important;
    }
    
    .sidebar-icon-mobile {
        display: block !important;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Favorite Button */
.favorite-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: 4px;
    transition: all var(--transition-speed);
    font-size: 16px;
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

.favorite-btn:hover {
    background-color: var(--bg-hover);
    color: var(--accent-color);
}

.favorite-btn.active {
    color: var(--accent-color);
}

.favorite-btn i {
    color: inherit;
}

/* Favorite Cards */
.favorites-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
    max-width: 800px;
}

.favorite-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: center;
}

.favorite-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.favorite-card-icon {
    font-size: 32px;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.favorite-card-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-tertiary);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.setting-item input[type="color"] {
    width: 60px;
    height: 35px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.setting-item select {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.setting-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.setting-item a:hover {
    text-decoration: underline;
}

.setting-item p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* Fullscreen Mode Styles */
.fullscreen-mode .content-body {
    padding: 0;
    overflow: hidden;
}

.fullscreen-content {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.fullscreen-exit-btn {
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.fullscreen-exit-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fullscreen-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fullscreen-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Light Theme */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f3f3;
    --bg-tertiary: #e8e8e8;
    --bg-hover: #e0e0e0;
    --bg-selected: #d0d0d0;
    
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-disabled: #999999;
    
    --border-color: #d0d0d0;
}

/* Pickr Color Picker Custom Styling */
.pcr-app[data-theme="monolith"] {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
}

.pcr-app[data-theme="monolith"] .pcr-selection {
    background: var(--bg-tertiary) !important;
}

.pcr-app[data-theme="monolith"] .pcr-interaction input {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 13px !important;
}

.pcr-app[data-theme="monolith"] .pcr-interaction input:focus {
    border-color: var(--accent-color) !important;
    outline: none !important;
}

.pcr-app[data-theme="monolith"] .pcr-interaction input::placeholder {
    color: var(--text-secondary) !important;
}

.pcr-app[data-theme="monolith"] .pcr-result {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 13px !important;
}

.pcr-app[data-theme="monolith"] .pcr-swatches button {
    border: 1px solid var(--border-color) !important;
}

.pcr-app[data-theme="monolith"] .pcr-swatches button:hover {
    transform: scale(1.1);
    z-index: 1;
}

.pcr-app[data-theme="monolith"] .pcr-clear,
.pcr-app[data-theme="monolith"] .pcr-save {
    background: var(--accent-color) !important;
    color: white !important;
    border: none !important;
    font-size: 13px !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    transition: background-color var(--transition-speed) !important;
}

.pcr-app[data-theme="monolith"] .pcr-clear:hover,
.pcr-app[data-theme="monolith"] .pcr-save:hover {
    background: var(--accent-hover) !important;
}

.pcr-app[data-theme="monolith"] .pcr-cancel {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 13px !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    transition: background-color var(--transition-speed) !important;
}

.pcr-app[data-theme="monolith"] .pcr-cancel:hover {
    background: var(--bg-hover) !important;
}

.pcr-app[data-theme="monolith"] .pcr-interaction .pcr-type {
    color: var(--text-secondary) !important;
    font-size: 12px !important;
}

.pcr-app[data-theme="monolith"] .pcr-interaction .pcr-type.active {
    color: var(--accent-color) !important;
}

/* Settings accent color display box */
.accent-color-box {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color var(--transition-speed);
}

.accent-color-box:hover {
    border-color: var(--accent-color);
}

/* Hidden Pickr container */
#accent-color-pickr-container {
    display: none;
}

