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

:root {
    /* Palette Dark Tech */
    --primary-color: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.5);
    --secondary-color: #7c3aed;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Backgrounds */
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --card-bg: rgba(17, 17, 27, 0.8);
    --card-border: rgba(255, 255, 255, 0.1);
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Effects */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px var(--primary-glow);
    --glow-strong: 0 0 40px var(--primary-glow), 0 0 80px var(--primary-glow);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 212, 255, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 20px 15px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--shadow-hover), var(--glow);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-bottom: 1px solid var(--card-border);
    color: white;
    padding: 25px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 6px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    position: relative;
    z-index: 1;
}

main {
    padding: 25px 30px;
    position: relative;
}

/* Configuration Section */
.config-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.config-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.config-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), var(--glow);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Email Section */
.email-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.email-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.email-section .form-group {
    margin-bottom: 0;
}

.email-section input[type="email"] {
    font-size: 1rem;
}

.email-section input[type="email"]:focus {
    border-color: var(--primary-color);
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed var(--card-border);
    border-radius: 20px;
    padding: 35px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.upload-area:hover::before,
.upload-area.drag-over::before {
    opacity: 1;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.3));
}

.upload-area h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.upload-area p {
    color: var(--text-secondary);
    margin: 8px 0;
    font-size: 0.9rem;
}

.file-info {
    font-size: 0.8rem;
    margin-top: 12px !important;
    color: var(--text-muted);
}

/* File Preview */
.file-preview {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.file-preview:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.preview-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.file-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.4));
}

.file-details {
    flex: 1;
}

.file-details h4 {
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.file-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-icon {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    transform: scale(1.05);
}

/* Progress Section */
.progress-section {
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        transparent,
        rgba(0, 212, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 0 20px var(--primary-glow);
    position: relative;
}

.progress-text {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.status-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Results Section */
.results-section {
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 24px;
    border-radius: 16px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.results-section h3 {
    color: var(--accent-color);
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 700;
}

.result-message {
    text-align: center;
    margin-bottom: 18px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.success-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

.result-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.result-text strong {
    color: var(--text-primary);
    display: block;
    margin-top: 6px;
}

.user-email-display {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 10px 20px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 6px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
}

.result-item {
    margin-bottom: 18px;
}

.result-item label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.link-container {
    display: flex;
    gap: 12px;
}

.link-container input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* Error Section */
.error-section {
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 30px;
    border-radius: 16px;
    border-left: 4px solid var(--danger-color);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.error-section h3 {
    color: var(--danger-color);
    margin-bottom: 18px;
    font-size: 1.4rem;
    font-weight: 700;
}

.error-section p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: var(--glow-strong);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-color), #059669);
    color: white;
    width: 100%;
    font-size: 1rem;
    padding: 14px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled::before {
    display: none;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    padding: 18px 30px;
    text-align: center;
    border-top: 1px solid var(--card-border);
}

footer p {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

#userInfo {
    margin-top: 10px;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .container {
        margin: 0;
        border-radius: 0;
    }

    main {
        padding: 24px;
    }

    .upload-area {
        padding: 50px 24px;
    }

    .link-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 40px var(--primary-glow), 0 0 60px var(--primary-glow);
    }
}

.config-section,
.upload-section,
.results-section,
.error-section {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
