/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-error ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.alert-error li {
    margin-bottom: 5px;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    color: #2c3e50;
    font-size: 2rem;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.boards-section, .recent-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.boards-section h2, .recent-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.board-card {
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.board-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.board-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.board-card .board-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Canvas Styles */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f8f9fa;
}

.toolbar {
    display: flex;
    align-items:center;
    margin-right:8px;
}

.tool-icons {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid #ecf0f1;
}

.tool-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.tool-icon:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

.tool-icon.active {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tool-icon svg {
    width: 14px;
    height: 14px;
}

#freehandTool {
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

#eraserTool {
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
}

.toolbar-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid #ecf0f1;
}

.toolbar-controls input[type="color"] {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 auto;
}

.toolbar-controls input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    outline: none;
}

.toolbar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    text-decoration: none;
}

.action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.action-btn.primary {
    background: #28a745;
    color: white;
}

.action-btn.primary:hover {
    background: #218838;
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

#canvas {
    cursor: crosshair;
    background: white;
}

/* Top Menu Styles */
.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.board-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.board-info h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.editable-title {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.editable-title:hover {
    background-color: #f8f9fa;
}

.board-title-input {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    border: 2px solid #3498db;
    border-radius: 4px;
    padding: 4px 8px;
    background: white;
    font-family: inherit;
}

.online-users {
    color: #27ae60;
    font-weight: 500;
    font-size: 0.9rem;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.board-tools {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow-x: auto;
    flex: 1 1 auto;
}

.board-tools .tool-icons {
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.top-actions .action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    text-decoration: none;
    flex-shrink: 0;
}

.top-actions .action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.top-actions .action-btn.primary {
    background: #28a745;
    color: white;
}

.top-actions .action-btn.primary:hover {
    background: #218838;
}

.toolbar .separator {
    width: 1px;
    height: 30px;
    background: #ddd;
    margin: 0 10px;
}

.toolbar input[type="color"] {
    width: 40px;
    height: 35px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.toolbar input[type="range"] {
    width: 80px;
}

#whiteboard {
    cursor: crosshair;
    background: white;
}

/* Zoom display */
.zoom-display {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    z-index: 1001;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-display:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

#userCursors {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

.user-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
}

.cursor-label {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

/* Drawing tools styling */
.tool-btn {
    min-width: 60px;
    padding: 8px 12px;
    font-size: 14px;
}

.tool-btn.active {
    background: #2980b9 !important;
    color: white;
}

/* Text toolbar styling */
.text-toolbar {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    min-width: max-content;
}

/* Drawing toolbar styling */
.drawing-toolbar {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    min-width: max-content;
}

.drawing-toolbar-content {
    display: flex;
    align-items: center;
    padding: 4px;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Drawing toolbar specific controls */
.drawing-toolbar .stroke-color,
.drawing-toolbar .fill-color {
    width: 24px;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}

.drawing-toolbar .stroke-width {
    width: 60px;
    height: 16px;
}

.drawing-toolbar .line-style {
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 10px;
    min-width: 50px;
}

.drawing-toolbar .width-value {
    font-size: 10px;
    color: #666;
    min-width: 25px;
}

.drawing-toolbar .close-toolbar {
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawing-toolbar .close-toolbar:hover {
    background: #f0f0f0;
}

.drawing-toolbar label {
    font-size: 10px;
    color: #666;
    margin-right: 2px;
}

.drawing-toolbar .transparent-fill {
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

.drawing-toolbar .transparent-fill:hover {
    background: #f0f0f0;
}

.drawing-toolbar .transparent-fill.active {
    background: #2980b9;
    color: white;
    border-color: #2980b9;
}

.text-toolbar-content {
    display: flex;
    align-items: center;
    padding: 4px;
    gap: 6px;
    flex-wrap: nowrap;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
    border-right: 1px solid #eee;
}

.toolbar-section:last-child {
    border-right: none;
}

/* Font controls */
.font-family {
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 10px;
    min-width: 60px;
}

.font-size {
    width: 35px;
    padding: 2px 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 10px;
    text-align: center;
}

/* Format buttons */
.format-btn, .align-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.format-btn:hover, .align-btn:hover {
    background: #f0f0f0;
}

.format-btn.active, .align-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

/* Color inputs */
.color-input {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    color: #666;
}

.color-input input[type="color"] {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}

.bg-transparent {
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-transparent:hover {
    background: #f0f0f0;
}

/* Border controls */
.border-style {
    padding: 2px 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 9px;
    min-width: 45px;
}

.border-width {
    width: 30px;
    padding: 2px 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 10px;
    text-align: center;
}

/* Action buttons */
.move-handle, .edit-text, .delete-text, .finish-edit {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.move-handle {
    cursor: move;
    font-weight: bold;
    letter-spacing: -1px;
}

.move-handle:hover {
    background: #3498db;
    color: white;
}

.edit-text:hover {
    background: #27ae60;
    color: white;
}

.delete-text:hover {
    background: #e74c3c;
    color: white;
}

.finish-edit:hover {
    background: #27ae60;
    color: white;
}

/* Text editor styling */
.text-editor-container {
    position: relative;
    min-width: 50px;
    min-height: 20px;
}

/* Canvas overlay text editor */
.canvas-text-editor {
    position: absolute;
    min-width: 100px;
    min-height: 30px;
    border: 2px solid #3498db;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    padding: 4px;
    outline: none;
    font-family: Arial, sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.text-input {
    font-family: Arial, sans-serif;
    border: 1px dashed #999 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 4px !important;
    outline: none !important;
    overflow: hidden !important;
    word-wrap: break-word;
    white-space: pre-wrap;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.text-input:focus {
    border: 1px solid #3498db !important;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #3498db;
    cursor: nw-resize;
    border: 1px solid #2980b9;
}

.resize-handle:hover {
    background: #2980b9;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .boards-grid {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-wrap: wrap;
        max-width: calc(100vw - 40px);
    }
    
    .canvas-info {
        position: relative;
        top: auto;
        right: auto;
        margin: 20px;
        text-align: center;
    }
    
    #whiteboard {
        margin: 20px auto;
        max-width: calc(100vw - 40px);
        height: auto;
    }
}

/* Draw Popup Styles */
.draw-popup {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    z-index: 10001;
}

.draw-popup-content {
    padding: 15px;
}

.draw-popup .popup-section {
    margin-bottom: 15px;
}

.draw-popup .popup-section:last-child {
    margin-bottom: 0;
}

.draw-popup label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.draw-popup select,
.draw-popup input[type="color"],
.draw-popup input[type="range"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.draw-popup input[type="color"] {
    height: 30px;
    padding: 2px;
    cursor: pointer;
}

.draw-popup input[type="range"] {
    margin-bottom: 5px;
}

.draw-popup .width-value {
    font-size: 11px;
    color: #777;
}

.draw-popup .close-popup {
    width: 100%;
    padding: 8px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.draw-popup .close-popup:hover {
    background: #2980b9;
}

/* Page Setup Panel */
.page-setup-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 1000;
}

.page-setup-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.page-setup-panel .panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.page-setup-panel .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.page-setup-panel .close-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.page-setup-panel .panel-content {
    padding: 20px;
}

.page-setup-panel .setting-group {
    margin-bottom: 20px;
}

.page-setup-panel .setting-group:last-child {
    margin-bottom: 0;
}

.page-setup-panel .setting-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.page-setup-panel .size-preset {
    margin-bottom: 8px;
}

.page-setup-panel .size-preset select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    transition: border-color 0.2s;
}

.page-setup-panel .size-preset select:focus {
    outline: none;
    border-color: #3498db;
}

.page-setup-panel .border-selector select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    transition: border-color 0.2s;
}

.page-setup-panel .border-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.page-setup-panel .size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-setup-panel .size-inputs input[type="number"] {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    transition: border-color 0.2s;
}

.page-setup-panel .size-inputs input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
}

.page-setup-panel .size-inputs span {
    font-size: 12px;
    color: #777;
}

.page-setup-panel .flip-btn {
    background: #3498db;
    border: 1px solid #2980b9;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: background-color 0.2s, color 0.2s;
    min-width: 32px;
    flex-shrink: 0;
    font-weight: bold;
}

.page-setup-panel .flip-btn:hover {
    background: #2980b9;
    color: white;
}

.page-setup-panel .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0 !important;
}

.page-setup-panel .checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.page-setup-panel .apply-btn {
    width: 100%;
    padding: 8px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.page-setup-panel .apply-btn:hover {
    background: #2980b9;
}

.page-setup-panel .pages-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.page-setup-panel .no-pages {
    padding: 12px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 11px;
}

.page-setup-panel .page-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    background: white;
    transition: background-color 0.2s;
}

.page-setup-panel .page-item:last-child {
    border-bottom: none;
}

.page-setup-panel .page-item:hover {
    background: #f5f5f5;
}

.page-setup-panel .page-name {
    flex: 1;
    font-size: 11px;
    color: #333;
    margin-right: 8px;
}

.page-setup-panel .page-actions {
    display: flex;
    gap: 5px;
}

.page-setup-panel .rename-btn,
.page-setup-panel .delete-btn {
    background: none;
    border: none;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.page-setup-panel .rename-btn {
    color: #3498db;
}

.page-setup-panel .rename-btn:hover {
    background: #e3f2fd;
}

.page-setup-panel .delete-btn {
    color: #e74c3c;
}

.page-setup-panel .delete-btn:hover {
    background: #fdeaea;
}

.page-setup-panel .rename-input {
    flex: 1;
    padding: 4px 6px;
    border: 1px solid #3498db;
    border-radius: 3px;
    font-size: 13px;
    margin-right: 10px;
}

.page-setup-panel .rename-actions {
    display: flex;
    gap: 3px;
}

.page-setup-panel .save-rename,
.page-setup-panel .cancel-rename {
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.page-setup-panel .save-rename {
    color: #27ae60;
}

.page-setup-panel .cancel-rename {
    color: #95a5a6;
}

/* Board Settings Panel */
.board-settings-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 1000;
}

.board-settings-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.board-settings-panel .panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.board-settings-panel .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.board-settings-panel .close-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.board-settings-panel .panel-content {
    padding: 20px;
}

.board-settings-panel .setting-group {
    margin-bottom: 20px;
}

.board-settings-panel .setting-group:last-child {
    margin-bottom: 0;
}

.board-settings-panel .setting-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.board-settings-panel .path-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.board-settings-panel .path-input-group input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    transition: border-color 0.2s;
}

.board-settings-panel .path-input-group input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

.board-settings-panel .browse-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.board-settings-panel .browse-btn:hover {
    background: #e9ecef;
}

.board-settings-panel .setting-description {
    margin-top: 6px;
    font-size: 11px;
    color: #777;
    line-height: 1.4;
}

.board-settings-panel .apply-btn {
    width: 100%;
    padding: 8px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.board-settings-panel .apply-btn:hover {
    background: #2980b9;
}

/* Export panel styles (same as page-setup-panel) */
.export-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 1000;
}

.export-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.export-panel .panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.export-panel .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.export-panel .close-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.export-panel .panel-content {
    padding: 20px;
}

.export-panel .setting-group {
    margin-bottom: 20px;
}

.export-panel .setting-group:last-child {
    margin-bottom: 0;
}

.export-panel .setting-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.export-panel .format-selector select,
.export-panel .mode-selector select,
.export-panel .quality-selector select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    transition: border-color 0.2s;
}

.export-panel .format-selector select:focus,
.export-panel .mode-selector select:focus,
.export-panel .quality-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.export-panel .apply-btn {
    width: 100%;
    padding: 8px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-panel .apply-btn:hover {
    background: #219a52;
}

.top-actions .action-btn:disabled{opacity:.38;cursor:not-allowed}

/* Must remain a real, focusable control so iPad opens its native keyboard. */
.canvas-mobile-text-input{position:fixed;left:8px;bottom:8px;width:1px;height:1px;opacity:.01;z-index:10002;border:0;resize:none}

@media (pointer:coarse){.tool-icon{width:44px;height:44px}.tool-icon svg{width:19px;height:19px}.top-actions .action-btn{min-width:44px;min-height:44px;flex-shrink:0}.board-nav-head button,.board-nav-new{min-height:38px}.board-nav-category a{min-height:38px;padding:9px 8px}.freehand-controls input,.freehand-controls select{min-height:32px}.freehand-controls{flex-wrap:wrap;max-width:calc(100vw - 80px)}}

.board-navigator{position:fixed;z-index:999;left:20px;top:330px;width:220px;max-height:calc(100vh - 350px);overflow:auto;background:#fff;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.1);padding:10px;font:13px Arial,sans-serif;transition:transform .18s ease}.board-navigator.collapsed{transform:translateX(-226px);overflow:visible}.board-nav-toggle{position:absolute;right:-28px;top:8px;width:28px;height:34px;border:0;border-radius:0 6px 6px 0;background:#fff;box-shadow:4px 2px 8px #0002;cursor:pointer;color:#075985;font-size:24px;line-height:1}
.board-nav-head{display:flex;align-items:center;justify-content:space-between;gap:6px;border-bottom:1px solid #e2e8f0;padding-bottom:8px}.board-nav-head button,.board-nav-new{border:0;border-radius:4px;background:#eef6ff;color:#075985;padding:5px;cursor:pointer;font-size:12px}.board-nav-category h3{margin:10px 0 3px;font-size:12px;color:#475569;text-transform:uppercase}.board-nav-category a{display:block;padding:6px 8px;border-radius:4px;color:#1e293b;text-decoration:none}.board-nav-category a:hover,.board-nav-category a.active{background:#dbeafe;color:#075985;font-weight:bold}.board-nav-new{width:100%;margin-top:8px;text-align:left}
.board-nav-category{border:1px solid transparent;border-radius:6px}.board-nav-category.drop-target{border-color:#60a5fa;background:#eff6ff}.board-nav-category a.dragging{opacity:.4}.board-nav-context{position:fixed;z-index:10050;border:1px solid #fecaca;border-radius:6px;background:#fff;color:#b91c1c;padding:10px 14px;box-shadow:0 3px 12px #0003;font:14px inherit;cursor:pointer}
@media(max-width:700px){.board-navigator{left:76px;top:76px;max-height:45vh;width:190px}.freehand-controls{top:50px;right:0;left:0}}
/* Vector freehand brush controls */
.freehand-controls{position:fixed;z-index:1000;top:50px;right:0;left:0;width:100%;max-width:none;display:flex;align-items:center;justify-content:center;gap:12px;min-height:42px;padding:6px 20px;box-sizing:border-box;background:#fff;border-top:1px solid #e2e8f0;border-bottom:1px solid #cbd5e1;box-shadow:0 3px 8px #0002;font:12px Arial,sans-serif}
.freehand-controls label{display:flex;align-items:center;gap:4px;white-space:nowrap}.freehand-controls input[type=range]{width:72px}.freehand-controls output{min-width:30px}.freehand-controls[hidden]{display:none}.freehand-brushes{display:flex;align-items:center;gap:4px;white-space:nowrap}.freehand-brush{border:1px solid #cbd5e1;border-radius:5px;padding:5px 8px;background:#fff;color:#334155;font:600 12px Arial,sans-serif;cursor:pointer}.freehand-brush:hover{border-color:#60a5fa;background:#eff6ff}.freehand-brush.active{border-color:#2563eb;background:#2563eb;color:#fff}
