@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0891b2;
    --secondary: #7c3aed;
    --accent: #10b981;
    --bg-page: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --border: rgba(0, 0, 0, 0.08);
    --text: #1e293b;
    --text-muted: #64748b;
    --font: 'Outfit', sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --glass-blur: blur(20px);
}

body.dark-mode {
    --primary: #22d3ee;
    --secondary: #a855f7;
    --accent: #10b981;
    --bg-page: #020617;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    background: var(--bg-page);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hidden {
    display: none !important;
}

/* Animated Background */
.background-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blob-move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -50px;
    right: -50px;
    animation-duration: 25s;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: 40%;
    left: 40%;
    animation-duration: 30s;
    animation-delay: -10s;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

@keyframes blob-move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

header {
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
}

nav {
    position: relative;
    z-index: 110;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    margin-left: 24px;
    font-size: 0.95rem;
    transition: var(--transition);
    opacity: 0.7;
    position: relative;
    z-index: 120;
    cursor: pointer;
}

nav a:hover {
    opacity: 1;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Glass Card */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 50px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.upload-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

.drop-zone-area {
    cursor: pointer;
    text-align: center;
}

.card-header {
    margin-bottom: 30px;
}

.down-arrow {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition);
}

.upload-card:hover .down-arrow {
    transform: translateY(5px);
    background: rgba(34, 211, 238, 0.1);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Circular Progress */
.circular-progress-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 120px;
    max-height: 120px;
    animation: spin 2s linear infinite;
    transform-origin: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
}

.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
}

/* File Pill */
.file-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.file-icon {
    font-size: 1.2rem;
}

#filename-display {
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#size-display {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Options Row */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.option-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-pill.active {
    background: rgba(34, 211, 238, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.toggle-container {
    cursor: default;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(14px);
}

/* Inputs */
.glass-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 12px;
    outline: none;
    transition: var(--transition);
}

body:not(.dark-mode) .glass-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0,0,0,0.12);
}

.glass-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

select.glass-input {
    appearance: none;
    cursor: pointer;
}

/* Fix dropdown option visibility in all modes */
.glass-input option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 10px;
}

body:not(.dark-mode) .glass-input option {
    background-color: #ffffff;
    color: #1e293b;
}

/* Share Button */
.share-btn {
    width: 100%;
    height: 60px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 20px -5px rgba(168, 85, 247, 0.4);
    margin-top: 10px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(168, 85, 247, 0.5);
    filter: brightness(1.1);
}

/* Result Area */
.input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    color: var(--primary);
    font-weight: 600;
}

#copy-btn {
    background: var(--text);
    color: var(--bg-page);
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* Cosmic Alerts System */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-icon-cosmic {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title-cosmic {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.modal-text-cosmic {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Toast System */
.cosmic-toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cosmic-toast {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cosmic-toast.active {
    transform: translateX(0);
    opacity: 1;
}

.cosmic-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Cosmic Colors & Gradients */
.bg-cosmic-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.bg-cosmic-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.bg-cosmic-error {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
}

.bg-cosmic-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* Buttons in Modals */
.cosmic-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.cosmic-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.cosmic-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cosmic-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Cosmic Download Button */
.btn-cosmic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 20px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
    background-size: 200% 200%;
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
    animation: cosmic-gradient 4s ease infinite, cosmic-pulse 2s infinite;
}

.btn-cosmic::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
}

.btn-cosmic:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.7);
    background-position: right center;
}

.btn-cosmic:active {
    transform: translateY(0) scale(0.98);
}

@keyframes cosmic-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes cosmic-pulse {
    0% {
        box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
    }

    50% {
        box-shadow: 0 10px 40px 5px rgba(6, 182, 212, 0.6);
    }

    100% {
        box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
    }
}

/* Responsive Refinements */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    header {
        height: 80px;
    }

    .logo {
        font-size: 1.3rem;
    }

    nav a:not(.btn) {
        display: none;
    }

    .glass-card {
        padding: 30px 20px;
        border-radius: 24px;
    }

    .circular-progress {
        width: 100px;
        height: 100px;
    }

    .percentage {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .options-row {
        gap: 8px;
    }

    .option-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .share-btn {
        height: 54px;
        font-size: 1rem;
        border-radius: 14px;
    }
}

