* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Upload Page Styles */
.upload-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #ffffff;
}

#imageInput,
#desktopImageInput {
    display: none;
}

/* Mobile Upload Styles */
.mobile-upload {
    display: none !important;
}

.mobile-upload.show {
    display: block !important;
}

.upload-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f7f7f7;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.upload-button:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
    transform: scale(1.05);
}

.upload-button.uploading {
    background: #f7f7f7;
    border-color: #d0d0d0;
    cursor: wait;
}

.upload-button.success {
    background: #f0f0f0;
    border-color: #9e9e9e;
}

.upload-button .material-icons {
    font-size: 48px;
    color: #37352f;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-button.uploading .material-icons {
    color: #6b6b6b;
    animation: spin 1s linear infinite;
}

.upload-button.success .material-icons {
    color: #37352f;
    animation: checkmark 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop Dropzone Styles */
.desktop-upload {
    display: none !important;
}

.desktop-upload.show {
    display: block !important;
}

.dropzone {
    width: 400px;
    height: 300px;
    border-radius: 19px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='15' stroke-linecap='square'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}

.dropzone:hover {
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='15' stroke-linecap='square'/%3e%3c/svg%3e");
}

.dropzone.dragover {
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='15' stroke-linecap='square'/%3e%3c/svg%3e");
}

.dropzone.uploading {
    animation: strokeRotate 1s linear infinite;
}

.dropzone.error {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.material-icons.dropzone-icon {
    font-size: 64px;
    color: #D7D3CA;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.dropzone:hover .dropzone-icon {
    opacity: 0.6;
}

.dropzone.dragover .dropzone-icon {
    opacity: 0.7;
}

@keyframes strokeRotate {
    0% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='20' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    12.5% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='10' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    25% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    37.5% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='-10' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    50% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='-20' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    62.5% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='-10' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    75% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    87.5% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='10' stroke-linecap='square'/%3e%3c/svg%3e");
    }
    100% {
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='19' ry='19' stroke='%23D7D3CA' stroke-width='7' stroke-dasharray='6%2c 14' stroke-dashoffset='20' stroke-linecap='square'/%3e%3c/svg%3e");
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px) scale(1); }
    20%, 40%, 60%, 80% { transform: translateX(10px) scale(1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Whiteboard Page Styles */
.whiteboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.whiteboard {
    flex: 1;
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
    min-height: 100vh;
}

.whiteboard-image {
    position: absolute;
    cursor: grab;
    transition: all 0.1s ease;
    transform: scale(1);
    transform-origin: center center;
    z-index: 1;
    min-width: 100px;
    min-height: 100px;
}

/* Rotation classes */
.whiteboard-image.rotate-neg2 {
    /* transform: rotate(-2deg); */
}

.whiteboard-image.rotate-neg1 {
    /* transform: rotate(-1deg); */
}

.whiteboard-image.rotate-0 {
    /* transform: rotate(0deg); */
}

.whiteboard-image.rotate-1 {
    /* transform: rotate(1deg); */
}

.whiteboard-image.rotate-2 {
    /* transform: rotate(2deg); */
}

/* Dragging state */
.whiteboard-image.dragging {
    /* transform: scale(1.1); */
    transition: none;
}

.whiteboard-image.dragging.rotate-neg2 {
    /* transform: rotate(-2deg) scale(1.1); */
}

.whiteboard-image.dragging.rotate-neg1 {
    /* transform: rotate(-1deg) scale(1.1); */
}

.whiteboard-image.dragging.rotate-0 {
    /* transform: rotate(0deg) scale(1.1); */
}

.whiteboard-image.dragging.rotate-1 {
    /* transform: rotate(1deg) scale(1.1); */
}

.whiteboard-image.dragging.rotate-2 {
    /* transform: rotate(2deg) scale(1.1); */
}

.whiteboard-image:hover:not(.dragging) {
    z-index: 10;
}

.whiteboard-image:hover .delete-button {
    opacity: 1;
    visibility: visible;
}

.whiteboard-image.dragging .delete-button,
.whiteboard-image.dragging .resize-handle {
    opacity: 0;
    visibility: hidden;
}

.whiteboard-image:active {
    cursor: grabbing;
}

.whiteboard-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    display: block;
}

.delete-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
}

.delete-button:hover {
    background: #cc0000;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: rgba(102, 126, 234, 0.8);
    border: 2px solid white;
    border-radius: 50% 0 8px 0;
    cursor: nwse-resize;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 15;
}

.whiteboard-image:hover .resize-handle {
    opacity: 1;
    visibility: visible;
}

.loading-message,
.empty-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-size: 1.1rem;
}

.empty-message a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.empty-message a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-card {
        padding: 30px 20px;
    }
    
    .whiteboard-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .whiteboard-header h1 {
        font-size: 1.5rem;
    }
    
}


.link-icon {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width:24vw;
    height:24vw;
}

/* Edge Docks */
.edge-dock {
    position: fixed;
    z-index: 1000;
    display: flex;
    pointer-events: none;
}

.edge-dock-top {
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.edge-dock-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.edge-dock-left {
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.edge-dock-right {
    right: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.dock-icon {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
    animation: dockIconAppear 0.3s ease-out;
}

.dock-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1001;
}

.dock-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.whiteboard-image.minimized {
    display: none;
    animation: minimizeImage 0.3s ease-out forwards;
}

.whiteboard-image.restoring {
    animation: restoreImage 0.3s ease-out forwards;
}

@keyframes dockIconAppear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes minimizeImage {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes restoreImage {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

