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

:root {
    --bg-color: #0a0a0f;
    --bg-secondary: #12121a;
    --card-bg: rgba(18, 18, 26, 0.8);
    --primary: #ffffff;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #5a5a70;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-lg: 24px;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.ambient-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: ambientMove 20s ease-in-out infinite;
}

@keyframes ambientMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(2%, 1%) rotate(1deg);
    }
    66% {
        transform: translate(-1%, 2%) rotate(-1deg);
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 60px;
}

.logo {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 12px;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
    animation: logoGlow 4s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        text-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
    }
    50% {
        text-shadow: 0 0 80px rgba(255, 255, 255, 0.2), 0 0 120px rgba(99, 102, 241, 0.1);
    }
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

.ca-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    animation: fadeIn 0.5s ease-out 0.5s forwards;
    opacity: 0;
}

.ca-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ca-address {
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text-primary);
    word-break: break-all;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ca-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ca-copy-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    transform: scale(1.1);
}

.ca-copy-btn.copied {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

main {
    flex: 1;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px;
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    transition: all 0.4s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-hover);
}

.upload-section {
    width: 100%;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 60px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 100%);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
    transform: scale(1.01);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
    opacity: 0.3;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: all 0.4s ease;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.drop-zone:hover .upload-icon {
    color: var(--accent);
    transform: scale(1.1);
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.drop-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    margin-top: 16px;
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

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

.file-preview #file-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    color: var(--text-primary);
    transform: scale(1.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

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

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

.loading-section {
    text-align: center;
    padding: 60px 24px;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.loading-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.preview-section {
    animation: fadeIn 0.5s ease-out;
}

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

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.preview-item {
    animation: scaleIn 0.5s ease-out backwards;
}

.preview-item:nth-child(1) {
    animation-delay: 0.1s;
}

.preview-item:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-item h3 {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.preview-image-container {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: all 0.4s ease;
}

.preview-image-container:hover {
    border-color: var(--border-hover);
    transform: scale(1.02);
}

.preview-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.checkered-bg {
    background-image: 
        linear-gradient(45deg, #1a1a24 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a24 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a24 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a24 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: var(--bg-secondary);
}

.options {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.action-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.error-section {
    text-align: center;
    padding: 40px 24px;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-5px);
    }
    40%, 80% {
        transform: translateX(5px);
    }
}

.error-section p {
    color: #f87171;
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

footer {
    text-align: center;
    padding-top: 60px;
    margin-top: auto;
}

footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .container {
        padding: 32px 16px;
    }
    
    .logo {
        font-size: 2.75rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .card {
        padding: 28px 20px;
    }
    
    .drop-zone {
        padding: 40px 16px;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}
