:root {
    --primary-color: #0078d4;
    --bg-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --error-color: #ff4d4d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body, html {
    height: 100%;
    overflow: hidden;
    background: var(--bg-gradient);
    color: var(--text-color);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Login Screen */
#login-screen {
    justify-content: center;
    align-items: center;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-card p {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

input[type="password"]:focus {
    border-color: var(--primary-color);
}

button {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.3s;
}

button:hover {
    filter: brightness(1.1);
}

.error-msg {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 1rem;
    height: 1rem;
}

/* Desktop Screen */
#desktop-screen {
    flex-direction: column;
}

.file-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-template-rows: repeat(auto-fill, 110px);
    gap: 15px;
    padding: 20px;
    align-content: flex-start;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    text-align: center;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.file-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.file-icon svg {
    width: 100%;
    height: 100%;
    fill: #ffd43b;
}

.icon-ext {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.4);
    padding: 1px 3px;
    border-radius: 2px;
}

.file-name {
    font-size: 0.75rem;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.2;
    padding: 0 4px;
}

/* Taskbar */
.taskbar {
    height: 48px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 15px;
    justify-content: space-between;
}

.upload-taskbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.upload-taskbar-btn:hover {
    opacity: 0.7;
}

.upload-taskbar-btn svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.status-info {
    font-size: 0.8rem;
    opacity: 0.8;
}

.upload-progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 20px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.3s ease;
}

/* Drag Overlay */
.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 120, 212, 0.4);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay-content {
    text-align: center;
}

.overlay-content svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

/* Context Menu / Actions */
.file-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: none;
    flex-direction: column;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.file-item:hover .file-actions {
    display: flex;
}

.action-btn {
    padding: 8px 15px;
    font-size: 0.7rem;
    background: transparent;
    text-align: left;
    border-radius: 0;
}

.action-btn:hover {
    background: var(--primary-color);
}

.floating-btn {
    position: fixed;
    bottom: 70px; /* Above taskbar */
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s, background 0.3s;
    z-index: 50;
    padding: 0;
}

.floating-btn:hover {
    background: var(--primary-color);
    transform: rotate(30deg);
}

.floating-btn svg {
    width: 24px;
    height: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: auto;
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-body img, .modal-body video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.modal-body pre {
    width: 100%;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        padding: 10px;
    }
    
    .file-item {
        padding: 5px;
    }

    .file-icon {
        width: 40px;
        height: 40px;
    }

    /* On mobile, show actions if the item has a 'selected' class or similar, 
       but for now, let's just make the taskbar more robust */
    
    .upload-progress-container {
        margin: 0 10px;
    }

    .status-info {
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
