body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    width: 100vw;
}

/* THE WHATSAPP-STYLE DOODLE BACKGROUND */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/skulls.png'),
                      url('https://www.transparenttextures.com/patterns/diagonal-stripes.png');
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/diagmonds-light.png');
    opacity: 0.2;
    pointer-events: none;
    z-index: -1;
}

/* Centered Background Logo */
.bg-logo-container {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: -1 !important;
    pointer-events: none;
    display: block !important;
}

.bg-logo {
    width: 500px !important;
    height: 500px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    opacity: 0.3 !important;
    filter: grayscale(20%) brightness(1.2) contrast(1.2) !important;
    border: 10px solid rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 0 100px rgba(0,0,0,0.8) !important;
}

/* Splash */
#loader {
    position: fixed;
    inset: 0;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    animation: fadeOut 1s ease 1.5s forwards;
    z-index: 9999;
}

.loader-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid #38bdf8;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* Layout */
.app {
    display: flex;
    height: 100vh;
    width: 100%;
    box-sizing: border-box;
}

/* Sidebar */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-right: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.sidebar-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #38bdf8;
}

.sidebar h2 {
    color: #38bdf8;
    font-size: 1.5rem;
    margin: 0;
}

.sidebar div {
    margin-top: 10px;
    cursor: pointer;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 0;
    min-width: 0;
    box-sizing: border-box;
}

/* Topbar */
.topbar {
    padding: 10px;
    background: #020617;
    box-sizing: border-box;
}

.topbar input {
    width: 100%;
    padding: 8px;
    background: #1e293b;
    border: none;
    color: white;
    box-sizing: border-box;
}

/* Grid/List Area */
.grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
}

/* Cards - Row Format */
.card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    transition: 0.3s;
    opacity: 0;
    transform: translateX(-20px);
    animation: cardIn 0.5s ease forwards;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.01);
}

/* File Info Section */
.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.file-name {
    font-weight: 800;
    font-size: 1.2rem;
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
    z-index: 10;
}

.file-size {
    font-size: 1rem;
    color: #cbd5e1 !important;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Actions Section */
.file-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-download {
    background: #38bdf8;
    color: #020617;
}

.btn-preview {
    background: rgba(255,255,255,0.1);
    color: white;
}

.btn-like {
    background: transparent;
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-like.liked {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    transform: scale(1.1);
}

.btn:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.reaction {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', emoji, sans-serif;
    font-size: 1.6rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    display: inline-block;
}

.reaction:hover {
    transform: scale(1.3) rotate(10deg);
}

.reaction:active {
    transform: scale(0.9);
}

/* Bot Container */
.bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 450px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 5000;
    transition: height 0.3s ease, opacity 0.3s ease;
}

.bot-container.minimized {
    height: 45px;
    overflow: hidden;
}

#bot-header {
    padding: 12px 15px;
    background: rgba(56, 189, 248, 0.2);
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #38bdf8;
}

#toggle-bot {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

#bot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

.bot-msg {
    background: rgba(255,255,255,0.1);
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.4;
    border-left: 3px solid #38bdf8;
}

.user-msg {
    background: #38bdf8;
    color: #020617;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
    align-self: flex-end;
    font-weight: 500;
}

#bot-input-area {
    padding: 10px;
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#bot-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 8px 12px;
    color: white;
    font-size: 0.85rem;
}

#bot-send {
    background: #38bdf8;
    border: none;
    border-radius: 15px;
    padding: 0 15px;
    cursor: pointer;
    font-weight: 600;
    color: #020617;
}

/* Preview Overlay */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.preview-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-preview {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10001;
}

.close-preview:hover {
    color: #38bdf8;
    transform: scale(1.2);
}

#previewBody img, #previewBody video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0, 0, 30px rgba(0,0,0,0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
