/* Properties Panel */
.properties-panel {
    width: 320px;
    background: var(--cream);
    border-left: 1px solid var(--tan);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.properties-header {
    padding: 12px 20px;
    background: var(--dark-gray);
    color: var(--cream);
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.properties-type-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.properties-type-icon {
    font-size: 20px;
    color: var(--cream);
}

.properties-type-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.properties-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.properties-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tan);
    text-align: center;
    padding: 20px;
}

.properties-empty.hidden {
    display: none;
}

/* Property Sections */
.property-section {
    margin-bottom: 20px;
}

.property-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--tan), transparent);
    margin: 20px 0;
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 12px;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.collapsible-header:hover {
    background: rgba(204, 197, 185, 0.15);
}

.collapsible-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--almost-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.collapsible-icon {
    font-size: 20px;
    color: #666;
    transition: transform 0.3s ease;
}

.collapsible-section.collapsed .collapsible-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 12px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.collapsible-section.collapsed .collapsible-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Size Control Buttons Row */
.size-controls-row {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
}

.size-btn:hover {
    background: rgba(204, 197, 185, 0.2);
    border-color: var(--dark-gray);
}

.size-btn:active {
    background: rgba(204, 197, 185, 0.4);
}

.size-btn .material-symbols-outlined {
    font-size: 18px;
    color: var(--almost-black);
}

/* Collapsed toggle active state */
#task-collapsed-toggle.active {
    background: rgba(204, 197, 185, 0.4);
    border-color: var(--dark-gray);
}

#task-collapsed-toggle.active .material-symbols-outlined {
    color: var(--dark-gray);
}

/* Node Action Buttons (above Colors section) */
.node-actions-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.node-actions-row:last-child {
    margin-bottom: 0;
}

.node-size-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.node-actions-separator {
    width: 1px;
    height: 28px;
    background: var(--tan);
    margin: 0 4px;
}

.node-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    padding: 0;
}

.node-action-btn svg {
    color: var(--almost-black);
}

.node-action-btn:hover {
    background: rgba(204, 197, 185, 0.2);
    border-color: var(--dark-gray);
}

.node-action-btn.active {
    background: var(--dark-gray);
    border-color: var(--dark-gray);
}

.node-action-btn.active svg {
    color: var(--cream);
}

.node-action-btn.active .material-symbols-outlined {
    color: var(--cream);
}

.node-action-btn:active {
    background: rgba(204, 197, 185, 0.4);
}

.node-action-btn .material-symbols-outlined {
    font-size: 20px;
    color: var(--almost-black);
}

/* Collapsed toggle active state for properties panel */
#task-collapsed-toggle.node-action-btn.active {
    background: rgba(204, 197, 185, 0.4);
    border-color: var(--dark-gray);
}

#task-collapsed-toggle.node-action-btn.active .material-symbols-outlined {
    color: var(--dark-gray);
}

/* Module convert button - compact icon-only version */
.module-convert-btn {
    width: auto;
    padding: 0 8px;
    gap: 2px;
}

.module-convert-btn .material-symbols-outlined {
    font-size: 16px;
}

.module-convert-arrow {
    font-size: 14px !important;
    opacity: 0.6;
}

/* Show folder icon when data-is-module="false", hide when "true" */
.module-convert-btn[data-is-module="false"] .module-icon-right {
    display: none;
}

.module-convert-btn[data-is-module="true"] .module-icon-left {
    display: none;
}

/* Hide arrow and show both icons on hover for preview */
.module-convert-btn:hover .module-convert-arrow {
    display: none;
}

.module-convert-btn:hover .module-icon-left,
.module-convert-btn:hover .module-icon-right {
    display: inline-flex !important;
}

.property-section-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.property-section-half {
    flex: 1;
    margin-bottom: 0;
}

.property-section-third {
    flex: 1;
    margin-bottom: 0;
}

/* Collapsed toggle now uses .size-btn class in size controls row */

.property-section label {
    display: block;
    font-weight: 600;
    color: var(--almost-black);
    font-size: 14px;
}

.property-section input[type="text"],
.property-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tan);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--almost-black);
    transition: border-color 0.2s;
}

.property-section input[type="text"]:focus,
.property-section textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.property-section textarea {
    resize: vertical;
    min-height: 80px;
}

.status-dropdown,
.task-display-type-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tan);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--almost-black);
    cursor: pointer;
    transition: border-color 0.2s;
}

.status-dropdown:focus,
.task-display-type-dropdown:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.text-color-selector-wrapper {
    position: relative;
}

.text-color-dropdown {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 1px solid var(--tan);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--almost-black);
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23403d39' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.text-color-dropdown:hover {
    border-color: #999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.text-color-dropdown:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(235, 94, 40, 0.1);
}

.text-color-dropdown option {
    padding: 8px;
    font-size: 14px;
}

#status-section {
    display: none;
}

#status-section.visible {
    display: block;
}

.status-label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.status-radio-group {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.status-radio-btn {
    cursor: pointer;
}

.status-radio-input {
    display: none;
}

.status-radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    transition: all 0.2s;
    overflow: hidden;
}

.status-radio-btn:hover .status-radio-label {
    background: rgba(204, 197, 185, 0.2);
    border-color: var(--dark-gray);
}

.status-radio-input:checked + .status-radio-label {
    background: rgba(204, 197, 185, 0.35);
    border-color: var(--dark-gray);
}

.status-radio-input:checked + .status-radio-label .status-badge {
    filter: brightness(1.1);
}

.status-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding-top: 1px; /* Optical centering - 5% of ~20px */
    line-height: 1;
}

.status-badge.status-new {
    background-color: #ffffff;
    color: #252422;
}

.status-badge.status-open {
    background-color: #3498db;
    color: #ffffff;
}

.status-badge.status-closed {
    background-color: #95a5a6;
    color: #ffffff;
}

#taskid-section {
    display: none;
}

#taskid-section.visible {
    display: block;
}

#task-display-type-section {
    display: none;
}

#task-display-type-section.visible {
    display: block;
}

/* task-collapsed-section removed - collapsed toggle now in size controls row */

/* Shape section now inside collapsible wrapper - no need for visibility toggle */

.module-toggle-container {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--tan);
}

.module-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--almost-black);
}

.module-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Shape controls container */
.shape-controls-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.current-shape-preview-inline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    max-height: 36px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    padding: 4px;
}

.current-shape-preview-inline svg,
.current-shape-preview-inline img {
    max-width: 100%;
    max-height: 28px;
    object-fit: contain;
}

.current-shape-preview-inline span {
    font-size: 11px;
    color: var(--tan);
}

.current-shape-preview-large {
    min-height: 60px;
    max-height: 80px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.current-shape-preview-large svg,
.current-shape-preview-large img {
    max-width: 100%;
    max-height: 64px;
    object-fit: contain;
}

.current-shape-preview-large span {
    font-size: 12px;
    color: var(--tan);
}

.shape-scale-controls {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}

.scale-btn {
    flex: 1;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--almost-black);
    transition: all 0.2s;
}

.scale-btn:hover {
    background: rgba(204, 197, 185, 0.2);
    border-color: var(--dark-gray);
}

.scale-btn.active {
    background: var(--dark-gray);
    border-color: var(--dark-gray);
    color: var(--cream);
}

.current-shape-preview {
    margin-top: 8px;
    padding: 10px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-shape-preview svg {
    max-width: 100px;
    max-height: 60px;
}

/* Custom URL styles moved to shape modal section above */

/* Shape mode selector styles now in forms.css (shared with create popup) */

.shape-option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shape-option-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--almost-black);
}

.shape-align-buttons,
.shape-size-buttons {
    display: flex;
    gap: 4px;
}

.btn-shape-align,
.btn-shape-align-y,
.btn-shape-size {
    flex: 1;
    padding: 8px;
    background: white;
    border: 1px solid var(--tan);
    color: var(--almost-black);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-shape-align .material-symbols-outlined,
.btn-shape-align-y .material-symbols-outlined {
    font-size: 18px;
}

.btn-shape-align:hover,
.btn-shape-align-y:hover,
.btn-shape-size:hover {
    background: rgba(235, 94, 40, 0.1);
    border-color: var(--accent-orange);
}

.btn-shape-align.active,
.btn-shape-align-y.active,
.btn-shape-size.active {
    background: var(--accent-orange);
    color: var(--cream);
    border-color: var(--accent-orange);
}

/* Shape mode styles now in forms.css for consistency */

.shape-item {
    border: 2px solid var(--tan);
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.shape-item:hover {
    border-color: var(--accent-orange);
    background: rgba(235, 94, 40, 0.05);
}

.shape-item.selected {
    border-color: var(--accent-orange);
    background: rgba(235, 94, 40, 0.1);
}

.shape-preview {
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-preview svg {
    max-width: 100%;
    max-height: 100%;
}

.shape-name {
    font-size: 10px;
    color: var(--almost-black);
    text-align: center;
}

/* btn-clear-shape styles moved above near btn-select-shape */

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

.shape-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.shape-modal.hide {
    display: flex;
    animation: fadeOut 0.3s ease-out;
}

.shape-modal.hide .shape-modal-content {
    animation: modalSlideOut 0.3s ease-out;
}

.shape-modal-content {
    background: var(--cream);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

.shape-modal.show .shape-modal-content {
    animation: slideIn 0.3s ease-out;
}

.shape-modal.hide .shape-modal-content {
    animation: slideOut 0.3s ease-out;
}

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

.shape-modal-header h3 {
    margin: 0;
    color: var(--almost-black);
    font-size: 18px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--almost-black);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Shape modal fixed controls (search, custom URL, mode selector) */
.shape-modal-fixed-controls {
    padding: 15px 20px;
    border-bottom: 1px solid var(--tan);
    background: #fafaf8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shape-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tan);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--almost-black);
}

.shape-search-input:focus {
    outline: none;
    border-color: var(--accent-orange);
}

/* Custom URL container */
.custom-url-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-url-container label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-gray);
}

.shape-custom-url-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--tan);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    color: var(--almost-black);
}

.shape-custom-url-input:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.shape-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.shape-grid-large {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Shape category header */
.shape-category-header {
    font-size: 14px;
    font-weight: 600;
    color: #252422;
    padding: 8px 0 4px 0;
    border-bottom: 2px solid #eb5e28;
    margin-top: 8px;
}

.shape-category-header:first-child {
    margin-top: 0;
}

/* Shape category grid */
.shape-category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Module checkbox - hidden */
/* Module toggle container styles defined above at line 225 */

/* Color Picker */
/* All color picker styles now in forms.css for consistency */

/* Tags */
#tags-section {
    display: none; /* Hidden per user request */
}

.tags-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
    padding: 8px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-orange);
    color: var(--cream);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-remove {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tag-input-container {
    display: flex;
    gap: 8px;
}

.tag-input-container input {
    flex: 1;
}

.btn-add-tag {
    background: var(--accent-orange);
    border: none;
    color: var(--cream);
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-add-tag .material-symbols-outlined {
    font-size: 20px;
}

.btn-add-tag:hover {
    background: #d14d1f;
}

/* Action Button (Reset Size, etc.) */
.btn-action {
    width: 100%;
    padding: 12px;
    background: #3498db;
    border: 1px solid #2980b9;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-action:hover {
    background: #2980b9;
}

/* Delete Button */
.btn-delete {
    display: none; /* Hidden per user request */
    width: 100%;
    padding: 12px;
    background: var(--almost-black);
    border: 1px solid var(--tan);
    color: var(--cream);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: var(--dark-gray);
}

/* Scrollbar Styling */
.properties-content::-webkit-scrollbar {
    width: 8px;
}

.properties-content::-webkit-scrollbar-track {
    background: var(--cream);
}

.properties-content::-webkit-scrollbar-thumb {
    background: var(--tan);
    border-radius: 4px;
}

.properties-content::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* Module Toggle Section */
#module-toggle-section {
    margin-top: 10px;
}

.module-conversion-container {
    padding: 0;
}

.module-toggle-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--tan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 32px;
}

.module-toggle-button:hover {
    background: rgba(204, 197, 185, 0.2);
    border-color: var(--dark-gray);
}

.module-toggle-button:active {
    background: rgba(204, 197, 185, 0.4);
}

/* Folder state (not module) */
.module-toggle-button[data-is-module="false"] .module-toggle-state:first-child {
    color: var(--almost-black);
    font-weight: 600;
}

.module-toggle-button[data-is-module="false"] .module-toggle-state:last-child {
    color: #999;
    font-weight: 400;
}

.module-toggle-button[data-is-module="false"] .module-toggle-arrow {
    color: var(--dark-gray);
}

/* Module state */
.module-toggle-button[data-is-module="true"] .module-toggle-state:first-child {
    color: #999;
    font-weight: 400;
}

.module-toggle-button[data-is-module="true"] .module-toggle-state:last-child {
    color: var(--almost-black);
    font-weight: 600;
}

.module-toggle-button[data-is-module="true"] .module-toggle-arrow {
    color: var(--dark-gray);
    transform: rotate(180deg);
}

.module-toggle-state {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.module-toggle-state .material-symbols-outlined {
    font-size: 18px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.module-toggle-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.module-toggle-arrow .material-symbols-outlined {
    font-size: 16px;
    color: var(--dark-gray);
}

.module-toggle-text-left,
.module-toggle-text-right {
    font-size: 12px;
}
