:root {
    --primary-color: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --secondary-color: #00cec9;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --text-main: #2d3436;
    --text-sub: #636e72;
    --white: #ffffff;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --nav-height: 70px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed; /* Keep background static on scroll */
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation - Glassmorphism */
.navbar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--nav-height);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Main Container - Glass Card */
.main-container {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    
    max-width: 700px;
    width: 90%;
    margin: 40px auto;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header {
    margin-bottom: 50px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-sub);
    font-weight: 400;
}

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

.file-upload {
    background-color: #f8faff;
    border: 2px dashed #dce0e8;
    border-radius: var(--radius-lg);
    padding: 60px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background-color: #f0f3ff;
    transform: translateY(-2px);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-light);
    margin-bottom: 24px;
    transition: var(--transition);
}

.file-upload:hover .upload-icon {
    transform: scale(1.1);
    color: var(--primary-color);
}

.upload-content p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.upload-subtext {
    font-size: 0.85rem;
    color: #95a5a6;
}

.image-preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 30px;
    letter-spacing: 0.5px;
}

.primary-btn {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.3);
}

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

.primary-btn:disabled {
    background: #dfe6e9;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    color: #b2bec3;
}

.secondary-btn {
    background: #f1f2f6;
    color: var(--text-main);
    border: 1px solid transparent;
}

.secondary-btn:hover {
    background: #e4e7eb;
    border-color: #dcdde1;
}

/* Results */
.result-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.label-container {
    margin: 30px 0;
}

.result-bar-wrapper {
    margin-bottom: 24px;
    text-align: left;
}

.label-name {
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--text-main);
}

.bar-container {
    background-color: #f1f2f6;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.bar {
    height: 100%;
    border-radius: 10px;
    background: var(--primary-gradient);
    width: 0;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* Gradient overlay/shine effect for bar */
.bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

.percent {
    font-weight: 700;
    color: var(--primary-color);
}

/* Special colors for specific animals if needed, 
   but gradient generally looks good for all. 
   You can override if you want distinct colors. */
.bar.dog { background: linear-gradient(135deg, #ff9ff3, #feca57); }
.bar.cat { background: linear-gradient(135deg, #54a0ff, #00d2d3); }

/* Social Share */
.share-container {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.sns-buttons {
    display: flex;
    gap: 20px;
}

.share-btn {
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.share-btn:hover {
    transform: translateY(-4px) rotate(8deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.share-btn.native-share {
    border-radius: var(--radius-md);
    width: auto;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
}

.share-btn.twitter { background: #1DA1F2; color: white; }
.share-btn.facebook { background: #4267B2; color: white; }
.share-btn.copy { background: #fff; color: var(--text-main); border: 1px solid #eee; }

/* Content Sections */
.content-section {
    margin-top: 60px;
    text-align: left;
    padding-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.content-section h2 {
    font-size: 1.6rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-main);
    font-weight: 800;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.feature-card:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.feature-card p {
    color: var(--text-sub);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.feature-card ul {
    list-style: none;
}

.feature-card ul li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.feature-card ul li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* FAQ */
.faq-item {
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Language Toggle */
.lang-btn {
    background: none;
    border: 1px solid var(--text-sub);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    margin-left: 15px;
}

.lang-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.85rem;
    color: #b2bec3;
    text-align: center;
}

.footer-links {
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    margin: 0 12px;
    transition: var(--transition);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Loading Spinner */
.loading {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading[hidden] {
    display: none !important;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(108, 92, 231, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

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

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

/* Responsive */
@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    header h1 {
        font-size: 3rem;
    }
}
