:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --error-color: #ef4444;
    --success-color: #22c55e;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Dynamic Background Globes */
.background-globes {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-color);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.globe-2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: -5%;
    right: -5%;
    animation-delay: -2s;
}

.globe-3 {
    width: 250px;
    height: 250px;
    background: #ec4899;
    top: 40%;
    left: 40%;
    opacity: 0.4;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* App Container */
.app-container {
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transition: all 0.3s ease;
}

.app-header {
    margin-bottom: 2.5rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.drop-content {
    pointer-events: none;
    /* Let events pass through to drop zone container */
}

.drop-icon {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.drop-zone:hover .drop-icon {
    color: var(--accent-color);
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.drop-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.browse-btn {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
    /* Re-enable pointer events for the browse link */
}

.supported-formats {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.7;
}

/* URL Input Section */
.url-input-container {
    margin-top: 2rem;
    animation: fadeIn 0.8s ease-out;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider span {
    padding: 0 1rem;
}

.input-group {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.input-group input {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

#url-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#url-btn:hover {
    transform: scale(1.05);
    background: #2563eb;
}

/* Media Viewer */
.media-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.5s ease-out;
}

.media-viewer.hidden {
    display: none;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Login UI */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.login-container.hidden {
    display: none;
}

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 3.5rem 2.5rem;
    border-radius: 28px;
    text-align: center;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
    max-width: 420px;
    width: 92%;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-box h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.5;
}

.google-btn {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.google-btn:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-color: #d1d5db;
}

.google-btn i {
    font-size: 1.2rem;
    color: #4285F4;
    /* Google Blue */
}




/* User Info Header */
.header-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.logout-btn {
    color: var(--error-color);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    background: #2563eb;
}

/* Utility to hide main app */
.app-container.hidden {
    display: none;
}

.media-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.media-content img,
.media-content video {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.media-content audio {
    width: 80%;
    border-radius: 50px;
}

.error-msg {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

/* Interactivity & Animations */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-box,
.app-container {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drop-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--accent-glow);
}

.drop-zone.dragover i {
    animation: bounce 0.6s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.media-viewer.active {
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        width: 100%;
        height: 100%;
        /* Full height on mobile */
        border-radius: 0;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
    }

    .app-header h1 {
        font-size: 1.8rem;
    }

    .media-content {
        min-height: 200px;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }
}