/* TrixStudio Canvas Designer - Enhanced Styles */

:root {
    --tcd-primary: #667eea;
    --tcd-secondary: #764ba2;
    --tcd-bg-light: #f8f9fa;
    --tcd-bg-dark: #1a1a1a;
    --tcd-text-light: #333;
    --tcd-text-dark: #fff;
    --tcd-border-light: #ddd;
    --tcd-border-dark: #444;
}

body.tcd-dark-theme {
    --tcd-bg: var(--tcd-bg-dark);
    --tcd-text: var(--tcd-text-dark);
    --tcd-border: var(--tcd-border-dark);
}

body.tcd-light-theme {
    --tcd-bg: var(--tcd-bg-light);
    --tcd-text: var(--tcd-text-light);
    --tcd-border: var(--tcd-border-light);
}

#tcd-container {
    display: flex;
    height: 100vh;
    background: var(--tcd-bg, #f8f9fa);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#tcd-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    width: 100%;
}

#tcd-toolbar {
    position: relative;
    z-index: 20;
}

/* Tool Button Active State */
.tcd-tool-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

#tcd-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 50px;
    position: relative;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

#tcd-toolbar::-webkit-scrollbar {
    height: 6px;
}

#tcd-toolbar::-webkit-scrollbar-track {
    background: transparent;
}

#tcd-toolbar::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

#tcd-toolbar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Brand Section */
.tcd-brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 8px;
}

.tcd-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 16px;
    color: #495057;
}

.tcd-logo-icon {
    font-size: 18px;
}

.tcd-logo-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tcd-theme-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 8px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tcd-theme-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tcd-theme-icon {
    font-size: 14px;
    display: block;
}

/* Toolbar Dividers */
.tcd-toolbar-divider {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 4px;
}

/* Section Labels */
.tcd-section-label {
    display: none;
}

/* Tool Sections */
.tcd-tools-section, .tcd-panel-section, .tcd-zoom-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Actions section should be flexible */
.tcd-actions-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
}

/* Tool Groups */
.tcd-tool-group {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
    min-width: fit-content;
}

/* Color Palette */
.tcd-color-palette {
    display: flex;
    gap: 5px;
    padding: 5px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
}

.tcd-color-preset {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.tcd-color-preset:hover {
    transform: scale(1.1);
    border-color: var(--tcd-primary);
}

/* Zoom Controls */
.tcd-zoom-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.tcd-zoom-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    color: #6c757d;
}

.tcd-zoom-btn:hover {
    background: #e9ecef;
}

.tcd-zoom-display {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    min-width: 40px;
    text-align: center;
    padding: 4px 6px;
}

/* Toolbar Spacer */
.tcd-toolbar-spacer {
    flex: 1;
}

/* Action Buttons Section - Updated above */

.tcd-action-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 8px 6px !important;
    border: none !important;
    border-radius: 3px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    color: #6c757d !important;
    min-width: 48px !important;
    min-height: 42px !important;
}

.tcd-action-btn:hover {
    background: #e9ecef;
}

.tcd-primary-btn {
    background: #007bff !important;
    color: white !important;
}

.tcd-primary-btn:hover {
    background: #0056b3 !important;
}

.tcd-secondary-btn:hover {
    background: #e9ecef !important;
}

.tcd-accent-btn {
    background: #fd7e14 !important;
    color: white !important;
}

.tcd-accent-btn:hover {
    background: #e8650e !important;
}

.tcd-action-btn .tcd-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.tcd-action-btn .tcd-btn-label {
    font-size: 10px;
    font-weight: 500;
    color: inherit;
    margin-top: 2px;
    text-align: center;
    line-height: 1;
}

#tcd-canvas-wrapper {
    flex: 1;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
    transition: all 0.3s ease;
}

#tcd-canvas-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#tcd-canvas-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#tcd-canvas-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#tcd-canvas-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#tcd-canvas {
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

/* Simple Tool Buttons */
.tcd-tool-btn {
    padding: 8px 6px;
    border: none;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 42px;
    color: #6c757d;
}

.tcd-tool-btn:hover {
    background: #e9ecef;
}

.tcd-tool-btn.active {
    background: #007bff;
    color: white;
}

.tcd-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.tcd-btn-label {
    font-size: 10px;
    font-weight: 500;
    color: inherit;
    margin-top: 2px;
    text-align: center;
    line-height: 1;
}

/* Buttons */
.tcd-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tcd-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

#tcd-add-canvas {
    width: 100%;
    margin-bottom: 15px;
    background: #007cba;
    color: white;
    border-color: #005a87;
}

#tcd-add-canvas:hover {
    background: #005a87;
}

/* Canvas List */
#tcd-canvas-list {
    max-height: 400px;
    overflow-y: auto;
}

.tcd-canvas-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.tcd-canvas-item:hover {
    background: #f0f0f0;
    border-color: #999;
}

.tcd-canvas-item.active {
    background: #e7f3ff;
    border-color: #007cba;
}

.tcd-canvas-item h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.tcd-canvas-item .tcd-canvas-meta {
    font-size: 12px;
    color: #666;
}

.tcd-canvas-item .tcd-canvas-actions {
    margin-top: 8px;
}

.tcd-canvas-item .tcd-canvas-actions button {
    padding: 4px 8px;
    font-size: 12px;
    margin-right: 5px;
}

/* Form Controls */
#tcd-canvas-name {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#tcd-canvas-status {
    font-size: 12px;
    color: #666;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 3px;
}

/* Toolbar Controls */
.tcd-separator {
    width: 1px;
    height: 30px;
    background: #ddd;
    margin: 0 5px;
}

#tcd-toolbar label {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

#tcd-toolbar input[type="color"] {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#tcd-toolbar input[type="range"] {
    width: 80px;
}

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

#tcd-modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#tcd-modal-title {
    margin: 0 0 15px 0;
    color: #333;
}

#tcd-modal-footer {
    margin-top: 20px;
    text-align: right;
}

#tcd-modal-footer button {
    margin-left: 10px;
}

/* Responsive */
/* Tablet styles */
@media (max-width: 1024px) {
    #tcd-toolbar {
        gap: 6px;
        padding: 6px 12px;
    }
    
    .tcd-toolbar-divider {
        height: 20px;
    }
    
    .tcd-action-btn .tcd-btn-label {
        font-size: 11px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    #tcd-container {
        flex-direction: column;
        height: auto;
    }
    
    #tcd-sidebar {
        width: 100%;
        height: 200px;
    }
    
    #tcd-toolbar {
        flex-wrap: wrap;
        gap: 4px;
        padding: 4px 8px;
        min-height: 60px;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .tcd-toolbar-divider {
        display: none;
    }
    
    .tcd-logo-text {
        display: none;
    }
    
    .tcd-brand-section {
        gap: 8px;
        margin-right: 4px;
    }
    
    .tcd-tool-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px 4px;
    }
    
    .tcd-btn-label {
        font-size: 9px;
    }
    
    .tcd-action-btn {
        padding: 6px 4px !important;
        font-size: 12px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    .tcd-action-btn .tcd-btn-label {
        display: none;
    }
    
    .tcd-toolbar-spacer {
        flex: 0;
        width: 8px;
    }
    
    #tcd-canvas-wrapper {
        height: 400px;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    #tcd-toolbar {
        padding: 4px;
        gap: 2px;
        min-height: 70px;
    }
    
    .tcd-tool-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 4px 2px;
    }
    
    .tcd-btn-label {
        font-size: 8px;
    }
    
    .tcd-action-btn {
        padding: 4px 2px !important;
        font-size: 11px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .tcd-tool-group {
        gap: 1px;
        padding: 1px;
    }
}

/* Canvas Size Modal */
.tcd-canvas-size-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.tcd-canvas-size-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tcd-canvas-size-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.tcd-canvas-size-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tcd-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.tcd-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tcd-canvas-size-body {
    padding: 24px;
}

.tcd-size-presets h4,
.tcd-custom-size h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.tcd-size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.tcd-size-preset {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tcd-size-preset:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tcd-size-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.tcd-size-label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.tcd-size-dims {
    font-size: 12px;
    color: #6b7280;
}

.tcd-custom-inputs {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.tcd-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.tcd-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.tcd-input-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.tcd-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tcd-apply-custom-size {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    height: fit-content;
}

.tcd-apply-custom-size:hover {
    background: #5a6fd8;
}

/* Notification */
.tcd-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.tcd-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tcd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: tcd-spin 1s linear infinite;
}

@keyframes tcd-spin {
    to { transform: rotate(360deg); }
}

/* Sticker Gallery */
#tcd-sticker-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tcd-sticker-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#tcd-sticker-content h3 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #333;
}

/* Sticker Tabs */
.tcd-sticker-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tcd-sticker-tab {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tcd-sticker-tab.active {
    color: var(--tcd-primary);
    border-bottom-color: var(--tcd-primary);
    background: rgba(102, 126, 234, 0.05);
}

.tcd-sticker-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--tcd-primary);
}

#tcd-sticker-grid {
    min-height: 200px;
    margin-bottom: 20px;
}

.tcd-sticker-category {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.tcd-sticker-category.active {
    display: grid;
}

.tcd-sticker-item {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9f9f9;
}

.tcd-sticker-item:hover {
    border-color: #007cba;
    background: #e7f3ff;
    transform: scale(1.1);
}

#tcd-sticker-close {
    width: 100%;
    padding: 10px;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

#tcd-sticker-close:hover {
    background: #555;
}

/* Colored Push Pins */
.tcd-pin-red { filter: hue-rotate(0deg) saturate(1.5); }
.tcd-pin-blue { filter: hue-rotate(240deg) saturate(1.5); }
.tcd-pin-green { filter: hue-rotate(120deg) saturate(1.5); }
.tcd-pin-yellow { filter: hue-rotate(60deg) saturate(1.5); }
.tcd-pin-purple { filter: hue-rotate(300deg) saturate(1.5); }
.tcd-pin-orange { filter: hue-rotate(30deg) saturate(1.5); }
.tcd-pin-pink { filter: hue-rotate(330deg) saturate(1.2); }
.tcd-pin-cyan { filter: hue-rotate(180deg) saturate(1.5); }
.tcd-pin-black { filter: grayscale(1) brightness(0.3); }
.tcd-pin-white { filter: grayscale(1) brightness(2) contrast(0.5); }

/* Colored Map Pins */
.tcd-map-red { filter: hue-rotate(0deg) saturate(1.5); }
.tcd-map-blue { filter: hue-rotate(240deg) saturate(1.5); }
.tcd-map-green { filter: hue-rotate(120deg) saturate(1.5); }
.tcd-map-yellow { filter: hue-rotate(60deg) saturate(1.5); }
.tcd-map-purple { filter: hue-rotate(300deg) saturate(1.5); }
.tcd-map-orange { filter: hue-rotate(30deg) saturate(1.5); }
.tcd-map-pink { filter: hue-rotate(330deg) saturate(1.2); }
.tcd-map-cyan { filter: hue-rotate(180deg) saturate(1.5); }
.tcd-map-black { filter: grayscale(1) brightness(0.3); }
.tcd-map-white { filter: grayscale(1) brightness(2) contrast(0.5); }

/* Pin hover effects */
.tcd-sticker-item[data-sticker*="pin"]:hover,
.tcd-sticker-item[data-sticker*="map"]:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.tcd-sticker-item[data-sticker*="map"]:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Modern Sticky Notes - Windows/Google Style */
.tcd-sticky-note {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.tcd-sticky-note:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.15);
}

.tcd-sticky-header {
    user-select: none;
}

.tcd-sticky-header button:hover {
    background: rgba(0,0,0,0.1);
}

.tcd-color-picker {
    user-select: none;
}

/* Layers Panel */
#tcd-layers-list {
    max-height: 400px;
    overflow-y: auto;
}

.tcd-layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--tcd-border, #ddd);
    border-radius: 6px;
    margin-bottom: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.tcd-layer-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: var(--tcd-primary);
}

.tcd-layer-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--tcd-primary);
}

.tcd-layer-visibility {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
}

.tcd-layer-name {
    flex: 1;
    font-size: 12px;
    color: var(--tcd-text, #333);
}

/* Enhanced Canvas List Design */
#tcd-canvas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.tcd-canvas-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tcd-canvas-item:hover {
    border-color: var(--tcd-primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.tcd-canvas-item.active {
    border-color: var(--tcd-primary);
    background: rgba(102, 126, 234, 0.05);
}

.tcd-canvas-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.tcd-canvas-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #666;
}

.tcd-canvas-date {
    color: #999;
}

.tcd-canvas-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tcd-canvas-item:hover .tcd-canvas-actions {
    opacity: 1;
}

.tcd-canvas-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.2s;
}

.tcd-canvas-action-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* Properties Panel Styles */
.tcd-property-group {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.tcd-property-group:last-child {
    border-bottom: none;
}

.tcd-property-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.tcd-property-row {
    display: flex;
    gap: 8px;
}

.tcd-property-row input {
    flex: 1;
}

.tcd-color-palette-small {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.tcd-color-preset-small {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.tcd-color-preset-small:hover {
    transform: scale(1.1);
    border-color: var(--tcd-primary);
}

.tcd-property-buttons {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.tcd-prop-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.tcd-prop-btn:hover {
    background: #f0f0f0;
}

.tcd-prop-btn.active {
    background: var(--tcd-primary);
    color: white;
    border-color: var(--tcd-primary);
}

.tcd-no-selection {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.tcd-no-canvases {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 10px;
    background: #f9f9f9;
}

/* Floating Properties Panel */
#tcd-floating-properties {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.tcd-properties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--tcd-primary), var(--tcd-secondary));
    color: white;
    border-radius: 12px 12px 0 0;
    cursor: move;
    user-select: none;
}

.tcd-properties-header:hover {
    background: linear-gradient(135deg, #5a6bc0, #7986cb);
}

.tcd-properties-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.tcd-properties-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.tcd-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.tcd-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.tcd-control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.2s;
}

.tcd-control-btn:hover {
    background: rgba(255,255,255,0.2);
}

.tcd-properties-body {
    padding: 20px;
}

/* Enhanced property inputs */
.tcd-property-group input[type="number"],
.tcd-property-group input[type="color"],
.tcd-property-group input[type="range"],
.tcd-property-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.tcd-property-group input[type="number"]:focus,
.tcd-property-group input[type="color"]:focus,
.tcd-property-group select:focus {
    border-color: var(--tcd-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.tcd-property-group input[type="range"] {
    padding: 0;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
}

.tcd-property-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--tcd-primary);
    border-radius: 50%;
    cursor: pointer;
}

.tcd-property-group input[type="color"] {
    height: 40px;
    padding: 2px;
    cursor: pointer;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    #tcd-floating-properties {
        right: 10px;
        left: 10px;
        width: auto;
        top: 10px;
    }
    
}

/* Modern Share Modal */
.tcd-share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.tcd-share-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: shareModalSlideIn 0.3s ease-out;
}

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

.tcd-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.tcd-share-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tcd-share-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tcd-share-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tcd-share-content {
    padding: 24px;
}

.tcd-share-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 24px;
}

.tcd-share-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcd-share-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #333;
}

.tcd-share-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.tcd-share-link-section {
    margin-bottom: 24px;
}

.tcd-share-link-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tcd-share-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tcd-share-link-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    transition: border-color 0.2s;
}

.tcd-share-link-container input:focus {
    outline: none;
    border-color: #667eea;
}

.tcd-copy-btn {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tcd-copy-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.tcd-share-note {
    margin: 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.tcd-share-options h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #333;
}

.tcd-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.tcd-share-btn {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tcd-share-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.tcd-share-btn.email:hover {
    border-color: #dc3545;
    background: #fff5f5;
}

.tcd-share-btn.whatsapp:hover {
    border-color: #25d366;
    background: #f0fff4;
}

@media (max-width: 600px) {
    .tcd-share-modal {
        width: 95%;
        margin: 20px;
    }
    
    .tcd-share-content {
        padding: 16px;
    }
    
    .tcd-share-buttons {
        grid-template-columns: 1fr;
    }
    
    .tcd-share-link-container {
        flex-direction: column;
    }
}

/* Floating Panels Styles */
.tcd-floating-panel {
    position: fixed;
    top: 100px;
    left: 50px;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    resize: both;
    min-width: 250px;
    min-height: 200px;
    max-width: 500px;
    max-height: 600px;
}

.tcd-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.tcd-panel-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.tcd-panel-controls {
    display: flex;
    gap: 4px;
}

.tcd-control-btn, .tcd-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tcd-control-btn:hover, .tcd-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tcd-close-btn:hover {
    background: rgba(220, 53, 69, 0.8);
}

.tcd-panel-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

/* Canvas List Panel Specific Styles */
#tcd-floating-canvas-list .tcd-panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#tcd-add-canvas {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

#tcd-add-canvas:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#tcd-canvas-list, #tcd-layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Canvas/Layer Item Styles */
.tcd-canvas-item, .tcd-layer-item {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tcd-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.tcd-item-icon {
    font-size: 16px;
}

.tcd-no-canvases, .tcd-no-layers {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.tcd-canvas-item:hover, .tcd-layer-item:hover {
    background: #e8ecff;
    border-color: #667eea;
    transform: translateY(-1px);
}

.tcd-canvas-item.active, .tcd-layer-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tcd-item-name {
    font-weight: 500;
    font-size: 14px;
}

.tcd-item-actions {
    display: flex;
    gap: 4px;
}

.tcd-item-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tcd-item-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.tcd-canvas-item.active .tcd-item-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tcd-canvas-item.active .tcd-item-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Panel positioning for different panels */
#tcd-floating-layers-list {
    left: 350px; /* Offset from canvas list */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tcd-floating-panel {
        width: 250px;
        top: 80px;
        left: 20px;
    }
    
    #tcd-floating-layers-list {
        left: 20px;
        top: 320px; /* Stack vertically on mobile */
    }
}

/* Microsoft Word-style Font Properties */
.tcd-font-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
}

.tcd-font-family-container {
    flex: 2;
}

.tcd-font-size-container {
    flex: 1;
}

.tcd-font-dropdown, .tcd-size-dropdown {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    font-family: inherit;
    margin-top: 4px;
}

.tcd-font-dropdown:focus, .tcd-size-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.tcd-formatting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.tcd-format-group {
    display: flex;
    gap: 2px;
}

.tcd-align-group {
    display: flex;
    gap: 2px;
}

.tcd-format-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #374151;
}

.tcd-format-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.tcd-format-btn.active {
    background: #e0e7ff;
    border-color: #667eea;
    color: #667eea;
}

.tcd-format-separator {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 0 4px;
}

.tcd-color-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
}

.tcd-text-color-container, .tcd-highlight-color-container {
    flex: 1;
}

.tcd-color-picker-wrapper {
    position: relative;
    margin-top: 4px;
}

.tcd-color-picker-wrapper input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 32px;
    cursor: pointer;
}

.tcd-color-btn {
    width: 100%;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: all 0.2s;
}

.tcd-color-btn:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tcd-color-icon, .tcd-highlight-icon {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 2px;
}

.tcd-color-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
}

.tcd-effects-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tcd-effects-group {
    display: flex;
    gap: 4px;
}

.tcd-effects-group .tcd-format-btn {
    width: 32px;
    font-size: 11px;
}

/* Font property labels */
#tcd-text-props label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    display: block;
}

/* Alignment button icons */
#tcd-align-left::before { content: "⬅"; }
#tcd-align-center::before { content: "↔"; }
#tcd-align-right::before { content: "➡"; }

/* Format button styling for better Word-like appearance */
#tcd-prop-bold strong {
    font-weight: 900;
}

#tcd-prop-italic em {
    font-style: italic;
    font-family: serif;
}

#tcd-prop-underline u {
    text-decoration: underline;
}

#tcd-prop-strikethrough s {
    text-decoration: line-through;
}

/* Responsive adjustments for font controls */
@media (max-width: 400px) {
    .tcd-font-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .tcd-formatting-row {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .tcd-color-row {
        flex-direction: column;
        gap: 8px;
    }
}
