/* 모던 글래스모피즘 디자인 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.37);
    --shadow-hover: 0 15px 35px rgba(31, 38, 135, 0.5);
    --border-radius: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 애니메이션 배경 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundMove {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 헤더 스타일링 */
header {
    text-align: center;
    margin-bottom: 40px;
    backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    animation: fadeInUp 0.8s ease-out;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 16px;
    color: white;
    font-size: 14px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.language-selector option {
    background: #2d3748;
    color: white;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)); }
}

header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* 메인 콘텐츠 레이아웃 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* 폼 섹션 */
.form-section {
    backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    animation: fadeInLeft 0.8s ease-out;
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* 업로드 영역 */
.upload-section {
    margin-bottom: 30px;
}

.upload-section h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-section h3::before {
    content: '📸';
    font-size: 1.2rem;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.upload-area:hover, .upload-area.dragover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-placeholder svg {
    color: rgba(255, 255, 255, 0.7);
    animation: float 2s ease-in-out infinite;
}

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

.upload-placeholder p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
}

.upload-placeholder small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

#uploadedImage {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 폼 필드 */
.form-fields h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-fields h3::before {
    content: '✨';
    font-size: 1.2rem;
}

.form-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 16px;
}

.form-fields .input-group {
    margin-bottom: 0;
}

.form-fields .input-group:nth-child(odd),
.form-fields .input-group:nth-child(even) {
    min-width: 0;
}

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

.input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-group input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 색상 테마 선택 */
.color-section {
    margin-bottom: 25px;
}

.color-section label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-section label::before {
    content: '🎨';
    font-size: 1rem;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 12px;
}

.color-options input[type="radio"] {
    display: none;
}

.color-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 3px solid transparent;
    display: block;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.color-options input[type="radio"]:checked + .color-option {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.color-option.blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.color-option.green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.color-option.purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.color-option.orange { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.color-option.white { background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); }
.color-option.black { background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%); }
.color-option.dark { background: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%); }

/* 개인정보 동의 */
.privacy-section {
    margin-bottom: 25px;
}

.privacy-consent {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.privacy-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.privacy-consent label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

.privacy-detail-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.privacy-detail-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.privacy-detail {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    backdrop-filter: blur(10px);
}

.privacy-detail h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 15px;
}

.privacy-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}

.privacy-content strong {
    color: white;
}

.privacy-content small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-style: italic;
}

/* 생성 버튼 */
.generate-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    border-radius: 16px;
    padding: 18px 24px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.6);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn svg {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* 미리보기 섹션 */
.preview-section {
    backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    animation: fadeInRight 0.8s ease-out;
    transition: all 0.3s ease;
    position: sticky;
    top: 20px;
}

.preview-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.preview-section h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.preview-section h3::before {
    content: '👁️';
    font-size: 1.4rem;
}

.card-preview {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    backdrop-filter: blur(10px);
}

#businessCard {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#businessCard:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* 다운로드 버튼 */
.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.download-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: 14px;
    padding: 14px 24px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(79, 172, 254, 0.6);
}

/* 광고 컨테이너 */
.ad-container {
    margin: 12px 0;
    display: flex;
    justify-content: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 푸터 */
.ad-footer {
    margin-top: 40px;
    text-align: center;
}

/* 알림 메시지 스타일링 */
.notification {
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInRight 0.3s ease-out, pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 반응형 디자인 - 모바일 최적화 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .preview-section {
        position: static;
        order: -1;
    }
    .form-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .form-section { padding: 16px; }
    .preview-section { padding: 16px; }
    
    .upload-area { padding: 24px 12px; }
    
    .color-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .color-option {
        width: 50px;
        height: 50px;
    }
    
    .generate-btn { padding: 14px 18px; font-size: 1rem; }
    
    .download-btn { padding: 12px 16px; font-size: 0.95rem; }
    
    .privacy-consent {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .privacy-consent label {
        min-width: auto;
    }
    
    .card-preview { padding: 12px; min-height: 180px; }
    
    #businessCard {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .form-section { padding: 14px; }
    .preview-section { padding: 14px; }
    
    .input-group input { padding: 12px 14px; font-size: 16px; /* iOS 줌 방지 */ }
    
    .upload-area { padding: 16px 10px; }
    
    .color-options { grid-template-columns: repeat(3, 1fr); }
    
    .generate-btn { padding: 12px 16px; }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .form-section,
    .preview-section {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .input-group input {
        border: 2px solid rgba(255, 255, 255, 0.4);
    }
}

/* 모션 줄이기 선호 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 터치 디바이스 최적화 */
@media (hover: none) {
    .color-option:hover,
    .generate-btn:hover,
    .download-btn:hover,
    .form-section:hover,
    .preview-section:hover {
        transform: none;
    }
    
    .generate-btn:active,
    .download-btn:active {
        transform: scale(0.98);
    }
}
