:root {
    --primary: #6366f1;
    --primary-light: #a5b4fc;
    --dog-color: #fbbf24;
    --cat-color: #f87171;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1f2937;
    overflow-x: hidden;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blob-float 20s infinite alternate;
}

.blob-1 { width: 400px; height: 400px; background: #818cf8; top: -100px; right: -100px; }
.blob-2 { width: 300px; height: 300px; background: #fb7185; bottom: -50px; left: -50px; animation-delay: -5s; }
.blob-3 { width: 250px; height: 250px; background: #fbbf24; top: 40%; left: 20%; animation-delay: -10s; }

@keyframes blob-float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 100px) scale(1.2); }
}

.app-container {
    width: 90%;
    max-width: 480px;
    padding: 30px 20px;
    text-align: center;
    z-index: 1;
}

header {
    margin-bottom: 30px;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.badge {
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: middle;
}

header p {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Decoration */
.deco-wrap {
    position: relative;
    height: 20px;
    width: 100%;
}

.float-icon {
    position: absolute;
    font-size: 1.5rem;
    animation: icon-float 3s infinite ease-in-out;
    opacity: 0.8;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float-icon:nth-child(1) { left: 10%; animation-delay: 0s; }
.float-icon:nth-child(2) { right: 10%; animation-delay: 0.5s; }
.float-icon:nth-child(3) { left: 30%; top: 40px; animation-delay: 1s; }
.float-icon:nth-child(4) { right: 30%; top: 40px; animation-delay: 1.5s; }

/* Card Style (Glassmorphism) */
.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* Upload Section */
.upload-area {
    width: 100%;
    aspect-ratio: 1/1;
    background: rgba(255,255,255,0.5);
    border: 2px dashed #d1d5db;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(255,255,255,0.8);
}

.icon-circle {
    font-size: 2.5rem;
    background: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#upload-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.main-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.main-btn:active { transform: scale(0.98); }

.sub-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    background: white;
    color: #4b5563;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 15px;
}

/* Loading Section */
.scanner {
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--primary-light), transparent);
    position: relative;
    overflow: hidden;
    animation: scan 2s infinite ease-in-out;
    opacity: 0.3;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.progress-line {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.progress-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: var(--primary);
    animation: load 1.5s infinite linear;
}

@keyframes load {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Result Section */
.result-header { margin-bottom: 25px; }
.result-header h2 { font-size: 1.8rem; margin-bottom: 5px; }
.result-header p { color: #6b7280; font-size: 0.9rem; }

.analysis-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.animal-score { text-align: left; }
.score-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 500; }
.bar-wrap { width: 100%; height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; }
.fill { height: 100%; width: 0; transition: width 1s cubic-bezier(0.17, 0.67, 0.83, 0.67); }

.dog .fill { background: var(--dog-color); }
.cat .fill { background: var(--cat-color); }

.trait-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: left;
}

.trait-card h3 { font-size: 0.95rem; margin-bottom: 12px; color: #4b5563; }
.trait-card ul { list-style: none; }
.trait-card li { 
    font-size: 0.9rem; 
    margin-bottom: 8px; 
    padding-left: 20px; 
    position: relative; 
    line-height: 1.4;
}
.trait-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #9ca3af;
}
