/* ShapeUp Whiteboard Styles */

/* Page Layout */
.shapeup-page {
    background: #f0f2f5;
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.shapeup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.shapeup-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.btn-header {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-header:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Container */
.shapeup-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Tool Panel */
.tool-panel {
    width: 200px;
    min-width: 200px;
    background: white;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    padding: 15px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.tool-section {
    margin-bottom: 20px;
}

#text-properties {
    display: none;
}

.tool-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #495057;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.tool-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tool-btn i {
    width: 18px;
    text-align: center;
}

.board-template-btn {
    background: white;
    border: 2px dashed #dee2e6;
    padding: 12px;
    text-align: center;
}

.board-template-btn:hover {
    border-color: #667eea;
    border-style: solid;
}

.board-template-btn .template-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #e9ecef;
}

#shapeup-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Canvas Controls */
.canvas-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.canvas-control-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #495057;
}

.canvas-control-btn:hover {
    background: #f8f9fa;
}

.canvas-control-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.canvas-control-btn.ai-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.canvas-control-btn.ai-toggle:hover {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.control-divider {
    width: 1px;
    background: #dee2e6;
    margin: 0 5px;
}

.zoom-level {
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
}

/* AI Prompt Panel */
.ai-prompt-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1001;
}

.ai-prompt-panel.show {
    display: flex;
}

.ai-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.ai-prompt-title {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.ai-prompt-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ai-prompt-close:hover {
    color: #333;
}

.ai-prompt-body {
    display: flex;
    gap: 10px;
}

.prompt-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 0.95rem;
    resize: none;
    min-height: 80px;
}

.prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.board-type-select {
    width: 150px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-generate:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

/* AI Options */
.ai-options {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.memory-search-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #495057;
}

.memory-search-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.memory-search-option span {
    user-select: none;
}

.memory-search-option:hover span {
    color: #667eea;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast-notification {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-notification.success { border-left-color: #28a745; }
.toast-notification.info { border-left-color: #667eea; }
.toast-notification.warning { border-left-color: #ffc107; }

.toast-notification .toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-notification.success .toast-icon { color: #28a745; }
.toast-notification.info .toast-icon { color: #667eea; }
.toast-notification.warning .toast-icon { color: #ffc107; }

.toast-notification .toast-content { flex: 1; }
.toast-notification .toast-title { font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.toast-notification .toast-message { font-size: 0.85rem; color: #6c757d; line-height: 1.4; }

.toast-notification .toast-details {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.8rem;
}

.toast-notification .toast-details .memory-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e9ecef;
}

.toast-notification .toast-details .memory-item:last-child { border-bottom: none; }

.toast-notification .toast-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* Progress indicator for Free Board */
.progress-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    text-align: center;
    min-width: 250px;
}

.progress-indicator .progress-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.progress-indicator .progress-text {
    font-size: 0.95rem;
    color: #495057;
}

/* Share Modal */
.share-url-input {
    background: #f8f9fa;
}

/* SVG Content Modal */
.svg-template-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.svg-template-btn {
    width: 36px;
    height: 36px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-template-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.svg-template-btn:hover svg path {
    stroke: white;
}

.svg-preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    min-height: 230px;
}

.svg-preview-container svg {
    border-radius: 4px;
}

.svg-preview-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #dc3545;
    font-size: 0.9rem;
}

.svg-preview-error i {
    font-size: 2rem;
}

#svg-path-input {
    font-size: 0.85rem;
    resize: vertical;
}

#svg-stroke-width {
    margin-top: 8px;
}

/* Board type colors */
.color-problem { color: #667eea; }
.color-breadboard { color: #00c6ff; }
.color-fatmarker { color: #11998e; }
.color-risk { color: #f093fb; }
.color-pitch { color: #ff6b6b; }

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 160px;
    z-index: 2000;
    display: none;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: #f0f2f5;
}

.context-menu-item.disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

.context-menu-item.disabled:hover {
    background: transparent;
}

.context-menu-item i {
    width: 16px;
    text-align: center;
    color: #667eea;
}

.context-menu-item.disabled i {
    color: #adb5bd;
}

.context-menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 6px 0;
}

/* Property Popup */
.property-popup {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 16px;
    min-width: 480px;
    max-width: 520px;
    z-index: 2001;
    display: none;
}

.property-popup.show {
    display: block;
}

.property-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.property-popup-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.property-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    font-size: 1rem;
    line-height: 1;
}

.property-popup-close:hover {
    color: #333;
}

.property-popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.property-popup .prop-section {
    margin-bottom: 0;
}

.property-popup .prop-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
}

.property-popup .prop-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.property-popup .prop-row.single {
    grid-template-columns: 1fr;
}

.property-popup .prop-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.property-popup .prop-item label {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
}

.property-popup .btn-group {
    display: flex;
}

.property-popup .btn-group .btn {
    flex: 1;
    padding: 4px 8px;
}

/* SVG Icons Panel Styles */
.svg-icons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.svg-icons-header:hover {
    color: #667eea;
}

.svg-icons-chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.svg-icons-panel.show + .svg-icons-chevron,
.svg-icons-panel.show ~ .svg-icons-chevron {
    transform: rotate(180deg);
}

.svg-icons-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.svg-icons-panel.show {
    display: flex;
}

.svg-icons-category {
    margin-bottom: 4px;
}

.svg-icons-category-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px dashed #e9ecef;
}

.svg-icons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.svg-icon-btn {
    width: 32px;
    height: 32px;
    padding: 4px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.svg-icon-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.svg-icon-btn:hover svg path {
    stroke: white;
}

.svg-icon-btn svg {
    width: 20px;
    height: 20px;
}

.svg-icon-btn svg path {
    stroke: #495057;
    transition: stroke 0.2s;
}

/* SVG Box Tool Active State */
#tool-svgbox.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Board Templates Panel (Collapsible) */
.board-templates-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.board-templates-header:hover {
    color: #667eea;
}

.board-templates-chevron {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.board-templates-panel {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
}

.board-templates-panel.show {
    display: flex;
}
