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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background: #0a0c14;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle at 20% 30%, rgba(46, 91, 255, 0.08) 0%, transparent 30%),
                radial-gradient(circle at 80% 70%, rgba(0, 255, 209, 0.06) 0%, transparent 35%),
                linear-gradient(135deg, #0a0c14 0%, #0f121c 100%);
    pointer-events: none;
    z-index: -1;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.3;
}

.orb-1 {
    width: min(400px, 80vw);
    height: min(400px, 80vw);
    background: #2563eb;
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: min(350px, 70vw);
    height: min(350px, 70vw);
    background: #2dd4bf;
    bottom: -100px;
    left: -100px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 30px) scale(1.1); }
}

.container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0.5rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 100px;
    padding: 0.5rem 1.2rem;
    margin-bottom: 1.2rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
}

.header h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 40%, #38bdf8 70%, #2dd4bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
    margin-bottom: 0.8rem;
}

.header p {
    color: #9aa4b8;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Grid */
.grid-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 3vw, 2.5rem);
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 768px) {
    .grid-panel {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}

/* Card */
.card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: clamp(1.5rem, 4vw, 2.5rem);
    padding: clamp(1.2rem, 3vw, 2.2rem);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    width: 100%;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(1rem, 2.5vw, 2rem);
    flex-wrap: wrap;
    gap: 0.8rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
}

.card-icon {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    background: linear-gradient(135deg, #2563eb20, #2dd4bf20);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: clamp(14px, 3vw, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: #38bdf8;
}

.card-title h2 {
    color: white;
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 600;
}

.card-title p {
    color: #64748b;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    margin-top: 0.2rem;
}

.card-status {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 100px;
    padding: 0.4rem 1rem;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* Status colors */
.status-ready {
    color: #4ade80;
    border-color: #4ade8030;
}
.status-uploading {
    color: #fbbf24;
    border-color: #fbbf2430;
}
.status-processing {
    color: #fbbf24;
    border-color: #fbbf2430;
}
.status-error {
    color: #f87171;
    border-color: #f8717130;
}
.status-standby {
    color: #94a3b8;
    border-color: #94a3b830;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(56, 189, 248, 0.2);
    border-radius: clamp(1.2rem, 4vw, 2rem);
    padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 3vw, 1.5rem);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(2, 10, 25, 0.3);
    margin-bottom: clamp(1rem, 3vw, 2rem);
    -webkit-tap-highlight-color: transparent;
}

.upload-area:active {
    transform: scale(0.98);
    background: rgba(56, 189, 248, 0.1);
}

.upload-area i {
    font-size: clamp(2.5rem, 8vw, 4rem);
    background: linear-gradient(135deg, #60a5fa, #2dd4bf);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.upload-area .text {
    color: #e2e8f0;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    font-weight: 500;
}

.upload-area .small {
    color: #5f6c86;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
}

/* Preview */
.preview-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: clamp(1.2rem, 4vw, 1.8rem);
    padding: clamp(0.5rem, 2vw, 1rem);
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: 100%;
}

.preview-box {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-height: 280px;
    border-radius: clamp(0.8rem, 3vw, 1.2rem);
    overflow: hidden;
    background: #0b1120;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.placeholder-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #334155;
    gap: 0.5rem;
    text-align: center;
    padding: 1rem;
}

.placeholder-preview i {
    font-size: clamp(2rem, 8vw, 3.5rem);
    opacity: 0.5;
}

/* URL Badge */
.url-badge {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 100px;
    padding: 0.7rem 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a5b4fc;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    width: 100%;
}

.url-badge i {
    color: #38bdf8;
    flex-shrink: 0;
}

.url-badge span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-badge.success {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

/* Button */
.btn {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    padding: clamp(0.8rem, 3vw, 1rem) clamp(1rem, 4vw, 2rem);
    border-radius: 100px;
    font-weight: 600;
    font-size: clamp(0.9rem, 3.5vw, 1rem);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    border: none;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #0891b2);
    box-shadow: 0 10px 30px -5px #2563eb80;
}

.btn-primary:not(:disabled):hover {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    transform: translateY(-2px);
}

.btn-primary:not(:disabled):active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Spinner */
.spinner {
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #38bdf8;
    border-right-color: #2dd4bf;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    border-width: 4px;
}

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

/* Result Image */
.result-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Download Button */
.download-btn {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #2dd4bf;
    color: white;
    border-radius: 100px;
    padding: clamp(0.7rem, 3vw, 0.9rem) clamp(1.2rem, 4vw, 2rem);
    font-size: clamp(0.85rem, 3vw, 1rem);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    text-decoration: none;
    min-width: 160px;
    min-height: 44px;
}

.download-btn:active {
    background: #2dd4bf20;
    transform: scale(0.96);
}

/* Status Message */
.status-message {
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border-radius: 100px;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

.status-message.success {
    color: #4ade80;
    border-color: #4ade8030;
}

.status-message.error {
    color: #f87171;
    border-color: #f8717130;
}

.status-message.info {
    color: #94a3b8;
    border-color: #94a3b830;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: clamp(1.5rem, 5vw, 3rem);
    padding-top: clamp(1rem, 3vw, 2rem);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 20px);
    color: #475569;
    font-size: clamp(0.7rem, 2.5vw, 0.95rem);
    flex-wrap: wrap;
}

.footer span {
    background: linear-gradient(135deg, #38bdf8, #2dd4bf);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.footer-divider {
    width: 4px;
    height: 4px;
    background: #475569;
    border-radius: 50%;
}

@media (max-width: 360px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
