:root {
    --bg-color: #f0f2f5;
    --text-color: #1c1e21;
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --ball-bg: #e9ecef;
    --ball-text: #333333;
    --primary-btn: #1877f2;
    --primary-btn-hover: #166fe5;
    --secondary-btn: #e4e6eb;
    --secondary-btn-hover: #d8dadf;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    --accent: #ff4757;
}

body.dark-mode {
    --bg-color: #18191a;
    --text-color: #e4e6eb;
    --card-bg: #242526;
    --nav-bg: #242526;
    --ball-bg: #3a3b3c;
    --ball-text: #e4e6eb;
    --primary-btn: #2d88ff;
    --primary-btn-hover: #4e9eff;
    --secondary-btn: #3a3b3c;
    --secondary-btn-hover: #4e4f50;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.main-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
header {
    padding: 20px 0;
    margin-bottom: 40px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--nav-bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-btn);
}

/* Introduction Section */
.intro-section {
    margin-bottom: 40px;
}

.profile-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: var(--shadow);
}

.profile-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-btn);
}

.profile-info h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.tagline {
    font-weight: 600;
    color: var(--primary-btn);
    margin-bottom: 15px;
}

.description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: color 0.2s, transform 0.2s;
}

.social-links a:hover {
    color: var(--primary-btn);
    transform: translateY(-3px);
}

/* Lotto Section */
.tool-section {
    margin-bottom: 40px;
}

.container {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.container h2 {
    margin-bottom: 10px;
}

.container p {
    margin-bottom: 30px;
    opacity: 0.8;
}

.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ball {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--ball-bg);
    color: var(--ball-text);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.1);
    transition: transform 0.2s, background-color 0.2s;
}

.ball.placeholder {
    opacity: 0.3;
}

/* 로또 번호대별 색상 */
.ball.range-1 { background-color: #fbc400; color: #fff; }
.ball.range-10 { background-color: #69c8f2; color: #fff; }
.ball.range-20 { background-color: #ff7272; color: #fff; }
.ball.range-30 { background-color: #aaa; color: #fff; }
.ball.range-40 { background-color: #b0d840; color: #fff; }

/* Buttons */
.btn-primary {
    background-color: var(--primary-btn);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    max-width: 300px;
}

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

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: var(--secondary-btn);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Contact Form */
.contact-form {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--secondary-btn);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-btn);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    border-color: #3a3b3c;
}

/* Responsive */
@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .profile-info h1 {
        font-size: 1.5rem;
    }
    
    .ball {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Animal Face Test Section */
.webcam-box, .image-box {
    margin: 0 auto 30px;
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 4px solid var(--primary-btn);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
}

.webcam-box canvas, .image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.prediction-labels {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.prediction-label {
    background-color: var(--secondary-btn);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    transition: background-color 0.2s;
}

body.dark-mode .prediction-label {
    background-color: #3a3b3c;
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-secondary {
    display: inline-block;
    background-color: var(--secondary-btn);
    color: var(--text-color);
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    max-width: 300px;
}

.btn-secondary:hover {
    background-color: var(--secondary-btn-hover);
}

.error-message {
    color: var(--accent);
    background-color: rgba(255, 71, 87, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}
