/* Desktop Files */
.desktop-files {
    position: absolute;
    top: 20px;
    left: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 120px); /* Account for dock height */
    pointer-events: none; /* Allow clicking through container */
    z-index: 100;
}

.desktop-file {
    position: absolute;
    width: 80px;
    height: 100px;
    cursor: pointer;
    pointer-events: auto; /* Re-enable for individual files */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
    user-select: none; /* Prevent text selection during drag */
    min-width: 80px;
    max-width: 80px;
    min-height: 100px;
    max-height: 100px;
    overflow: hidden;
}

.desktop-file:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-file.selected {
    background: rgba(0, 122, 255, 0.3);
    border: 1px solid rgba(0, 122, 255, 0.5);
}

.desktop-file.dragging {
    background: rgba(0, 122, 255, 0.4);
    border: 2px solid rgba(0, 122, 255, 0.7);
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: none; /* Disable transitions during drag for smooth movement */
}

.desktop-file img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    pointer-events: none; /* Prevent dragging on just the image */
    flex-shrink: 0;
}

.desktop-file-name {
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
    pointer-events: none; /* Prevent dragging on just the text */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 0;
    display: none;
    z-index: 10000;
    min-width: 150px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.context-menu-item {
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 4px 0;
}

/* Rename input overlay */
.rename-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 1001;
}

.rename-input {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007AFF;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    text-align: center;
    color: #333;
    outline: none;
    min-width: 80px;
    max-width: 120px;
}

.rename-error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin-top: 4px;
    text-align: center;
    max-width: 120px;
    word-wrap: break-word;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

.delete-confirmation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.confirmation-dialog {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
    min-width: 300px;
}

.confirmation-dialog p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Cursor styles for dragging */
.desktop-file:active {
    cursor: grabbing;
}