@charset "UTF-8";

/* CSS Variables */
:root {
    --bg-color: #f5f5f5;
    --content-bg-color: #ffffff;
    --border-color: #e0e0e0;
    --font-color: #333333;
    --primary-color: #2196F3;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --secondary-color: #757575;
    --postit-shadow: 0 5px 10px rgba(0,0,0,0.6);
    --new-postit-color: #ff1744;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding-top: 40px;
    overflow: hidden;
}

.main-container {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
}

/* Remove the floating title completely */
.floating-title {
    display: none;
}

/* Board Zoom Controls */
.board-zoom-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.board-zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #1a1a1a;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.board-zoom-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.zoom-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #1a1a1a;
    text-align: center;
    min-width: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.zoom-sign {
    font-size: 12px;
    font-weight: bold;
    margin-left: 2px;
}

/* Control Panel */
.control-panel {
    position: fixed;
    top: 60px;
    left: 20px;
    width: 280px;
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 150;
    transition: transform 0.3s ease;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.control-panel.hidden {
    transform: translateX(-320px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(33, 150, 243, 0.05);
    border-radius: 12px 12px 0 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--font-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Privacy Tooltip */
.privacy-tooltip {
    position: relative;
    cursor: help;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.privacy-tooltip:hover {
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--font-color);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    width: 180px;
    text-align: left;
    line-height: 1.4;
    z-index: 1000;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tooltip-text::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-bottom-color: var(--font-color);
}

.privacy-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.panel-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.panel-toggle:hover {
    background: rgba(0,0,0,0.1);
    color: var(--font-color);
}

.panel-content {
    padding: 0 20px 20px 20px;
}

/* Panel Toggle Button (when panel is hidden) */
.panel-toggle-btn {
    position: fixed;
    top: 70px;
    left: -25px;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    padding: 15px 30px 15px 40px;
    border-radius: 0 25px 25px 0;
    cursor: grab;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    user-select: none;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.panel-toggle-btn:active {
    cursor: grabbing;
}

.panel-toggle-btn.show {
    display: flex;
}

.panel-toggle-btn:hover:not(:active) {
    background: #1976D2;
    transform: translateY(-50%) translateX(10px);
}

.toggle-icon {
    font-size: 1.2rem;
}

.toggle-text {
    font-size: 0.8rem;
    font-weight: 600;
}

.control-section {
    margin-bottom: 25px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h4 {
    color: var(--font-color);
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
}

.option-group {
    margin-bottom: 15px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--font-color);
    font-size: 0.9rem;
}

/* Size Options */
.size-options,
.font-size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-btn,
.font-size-btn {
    padding: 6px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--content-bg-color);
    color: var(--font-color);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.size-btn:hover,
.font-size-btn:hover {
    border-color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.size-btn.active,
.font-size-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Color Options */
.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-btn {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-btn.active {
    border-color: var(--font-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Action Buttons */
.action-buttons,
.data-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #616161;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #D32F2F;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 0.9rem;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#zoomLevel {
    font-weight: 600;
    color: var(--font-color);
    min-width: 45px;
    text-align: center;
    font-size: 0.85rem;
}

/* Board Container */
.board-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: #fafafa;
    cursor: grab;
}

.board-container.dragging {
    cursor: grabbing;
}

/* Update the existing .board styles to ensure light background in light mode */
.board {
    position: absolute;
    width: 20000px;
    height: 20000px;
    top: 0;
    left: 0;
    background-color: var(--bg-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Cg fill='none' stroke='%23e0e0e0' stroke-width='0.5'%3E%3Cpath d='M0 25h50M25 0v50'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 50px 50px;
    transform-origin: 0 0;
    transition: transform 0.3s ease;
}

/* Light mode grid variations */
.board.grid-dotted {
    background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
    background-size: 25px 25px;
}

.board.grid-minimal {
    background-image: 
        linear-gradient(90deg, rgba(224,224,224,0.3) 1px, transparent 1px),
        linear-gradient(180deg, rgba(224,224,224,0.3) 1px, transparent 1px);
    background-size: 50px 50px;
}

.board.grid-none {
    background-image: none;
}

/* Post-It Styles */
.post-it {
    position: absolute;
    background: #fff59d;
    border: 1px solid #f9a825;
    border-radius: 4px;
    box-shadow: var(--postit-shadow);
    cursor: move;
    user-select: none;
    transform: rotate(-1deg);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1;
}

.post-it.new {
    border: 3px solid var(--new-postit-color);
    animation: newPostItPulse 2s infinite;
}

@keyframes newPostItPulse {
    0%, 100% { border-color: var(--new-postit-color); }
    50% { border-color: rgba(255, 23, 68, 0.5); }
}

.post-it:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 10;
}

.post-it.dragging {
    z-index: 50;
    transform: rotate(0deg) scale(1.05);
}

.post-it.small {
    width: 200px;
    height: 200px;
}

.post-it.medium {
    width: 300px;
    height: 300px;
}

.post-it.large {
    width: 400px;
    height: 400px;
}

.post-it.yellow {
    background: #fff59d;
    border-color: #f9a825;
}

.post-it.green {
    background: #c8e6c9;
    border-color: #66bb6a;
}

.post-it.blue {
    background: #bbdefb;
    border-color: #42a5f5;
}

.post-it.pink {
    background: #f8bbd9;
    border-color: #e91e63;
}

.post-it.orange {
    background: #ffcc80;
    border-color: #ff9800;
}

.post-it.purple {
    background: #d1c4e9;
    border-color: #9c27b0;
}

.post-it-drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    cursor: move;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.post-it:hover .post-it-drag-handle {
    opacity: 0.8;
}

.drag-dash {
    width: 100%;
    height: 1px;
    background: #000000;
    border-radius: 1px;
}

.post-it-content {
    width: 95%;
    height: 95%;
    border: none;
    background: transparent;
    resize: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #000000;
    padding: 28px 10px 10px 10px;
    outline: none;
    overflow-y: auto;
}

.post-it-content::-webkit-scrollbar {
    width: 4px;
}

.post-it-content::-webkit-scrollbar-track {
    background: transparent;
}

.post-it-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
}

.post-it-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.post-it:hover .post-it-delete {
    display: flex;
}

.post-it:hover .font-controls {
    display: flex;
}

.post-it:hover .post-it-content {
    padding-top: 3px;
}

.post-it-delete:hover {
    background: #D32F2F;
    transform: scale(1.1);
}

/* Font Size Controls */
.post-it-font-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    gap: 4px;
    z-index: 6;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.font-controls {
    text-align: center;
    justify-content: center;
    margin-top: 3px;
    display: none;
}

.font-btn {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Mobile-specific font button styling */
@media (max-width: 768px) {
    .font-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        touch-action: manipulation;
    }
}

/* Arrow styling with proper count display */
.arrow {
    position: absolute;
    background: var(--primary-color);
    color: white;
    min-width: 40px;
    height: 40px;
    border-radius: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 2000000;
    animation: pulse 2s infinite;
    padding: 0 8px;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.arrow:hover {
    background: #1976D2;
    transform: scale(1.1);
    animation: none;
}

.arrow.show {
    display: flex;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    50% { 
        box-shadow: 0 4px 16px rgba(33, 150, 243, 0.5);
    }
}

/* Remove font size options from panel */
.font-size-options {
    display: none;
}

.option-group:has(.font-size-options) {
    display: none;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--primary-color);
}

/* Confirmation Dialog */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.confirmation-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.confirmation-content h3 {
    margin: 0 0 15px 0;
    color: var(--font-color);
}

.confirmation-content p {
    margin: 0 0 25px 0;
    color: var(--secondary-color);
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Grid axis labels */
.grid-axis {
    position: absolute;
    font-size: 10px;
    color: var(--font-color);
    /*background: rgba(255, 255, 255, 0.8);*/
    background-color: var(--content-bg-color);
    padding: 2px 4px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
    font-family: monospace;
    font-weight: normal;
}

.axis-x {
    transform: translateX(-50%);
}

.axis-y {
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.axis-top {
    top: 5px;
}

.axis-bottom {
    bottom: 5px;
}

.axis-left {
    left: 5px;
}

.axis-right {
    right: 5px;
}

/* Update arrow positioning */
.arrow-top {
    top: 10px;
    transform: translateX(-50%);
}

.arrow-bottom {
    bottom: 10px;
    transform: translateX(-50%);
}

.arrow-left {
    left: 10px;
    transform: translateY(-50%);
}

.arrow-right {
    right: 10px;
    transform: translateY(-50%);
}

/* Panel toggle button fixes */
.panel-toggle-btn {
    position: fixed;
    top: 50px;
    left: -25px;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    padding: 15px 30px 15px 40px;
    border-radius: 0 25px 25px 0;
    cursor: grab;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    user-select: none;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.panel-toggle-btn:active {
    cursor: grabbing;
}

.panel-toggle-btn.show {
    display: flex;
}

.panel-toggle-btn:hover:not(:active) {
    background: #1976D2;
    transform: translateY(-50%) translateX(10px);
}

/* Update arrow positioning to stay within screen bounds */
.direction-arrow {
    position: fixed;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    flex-direction: column;
    gap: 2px;
}

.direction-arrow.show {
    display: flex;
}

.direction-arrow:hover {
    background: #1976D2;
    transform: scale(1.1);
}

.arrow-icon {
    font-size: 14px;
    line-height: 1;
}

.arrow-count {
    font-size: 10px;
    line-height: 1;
    font-weight: bold;
}

/* Constrain arrows to stay within viewport bounds */
#arrowTop {
    top: 10px;
    /* Left position will be constrained in JavaScript */
    min-left: 25px; /* Minimum distance from left edge */
    max-left: calc(100vw - 75px); /* Maximum distance from right edge */
}

#arrowBottom {
    bottom: 10px;
    /* Left position will be constrained in JavaScript */
    min-left: 25px;
    max-left: calc(100vw - 75px);
}

#arrowLeft {
    left: 10px;
    /* Top position will be constrained in JavaScript */
    min-top: 25px;
    max-top: calc(100vh - 75px);
}

#arrowRight {
    right: 10px;
    /* Top position will be constrained in JavaScript */
    min-top: 25px;
    max-top: calc(100vh - 75px);
}

/* Mobile responsive arrow adjustments */
@media (max-width: 768px) {
    .direction-arrow {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
    
    .arrow-icon {
        font-size: 12px;
    }
    
    .arrow-count {
        font-size: 9px;
    }
    
    #arrowTop,
    #arrowBottom {
        min-left: 20px;
        max-left: calc(100vw - 65px);
    }
    
    #arrowLeft,
    #arrowRight {
        min-top: 20px;
        max-top: calc(100vh - 65px);
    }
}

/* Add dark mode styles for the board */
@media (prefers-color-scheme: dark) {
    /* Dark mode board container */
    .board-container {
        background: #1a1a1a;
    }
    
    /* Dark mode board with dark grid */
    /*.board {
        background-color: #1a1a1a;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Cg fill='none' stroke='%23404040' stroke-width='0.5'%3E%3Cpath d='M0 25h50M25 0v50'/%3E%3C/g%3E%3C/svg%3E");
    }*/
    
    /* Dark mode grid variations */
    .board.grid-dotted {
        background-image: radial-gradient(circle, #404040 1px, transparent 1px);
        background-size: 25px 25px;
    }
    
    .board.grid-minimal {
        background-image: 
            linear-gradient(90deg, rgba(64,64,64,0.3) 1px, transparent 1px),
            linear-gradient(180deg, rgba(64,64,64,0.3) 1px, transparent 1px);
        background-size: 50px 50px;
    }
    
    .board.grid-none {
        background-image: none;
    }
}