/**
 * 작명 분석 전용 스타일시트
 * naming.php 및 naming_result.php에서 사용
 */

/* ============================================
   작명 컨테이너
   ============================================ */
.naming-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.naming-header {
    text-align: center;
    margin-bottom: 40px;
}

.naming-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.naming-header .subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* ============================================
   폼 스타일
   ============================================ */
.naming-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #34495e;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #6c5ce7;
}

/* 성씨 입력 자동완성 */
.surname-input-wrapper {
    position: relative;
    width: 100%;
}

.surname-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 2px solid #6c5ce7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-top: -2px;
}

.surname-option-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.surname-option-item:last-child {
    border-bottom: none;
}

.surname-option-item:hover {
    background: #f8f7ff;
}

.surname-hangul {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    min-width: 40px;
}

.surname-hanja {
    font-size: 1rem;
    font-weight: 600;
    color: #6c5ce7;
    min-width: 40px;
}

.surname-stroke {
    font-size: 0.9rem;
    color: #7f8c8d;
    padding: 2px 8px;
    background: #ecf0f1;
    border-radius: 4px;
}

.surname-meaning {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-left: auto;
}

/* 성별 선택 라디오 그룹 */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.radio-card input[type="radio"]:checked + .radio-content {
    border-color: #6c5ce7;
    background: linear-gradient(135deg, #667eea20, #764ba220);
}

.radio-content .icon {
    font-size: 2rem;
}

.radio-content .text {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 생년월일시 입력 */
.date-input-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-field label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.date-field input,
.date-field select {
    padding: 10px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.date-field input:focus,
.date-field select:focus {
    outline: none;
    border-color: #6c5ce7;
}

/* 작명 스타일 그리드 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.style-card {
    position: relative;
    cursor: pointer;
}

.style-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.style-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.style-card input[type="radio"]:checked + .style-content {
    border-color: #6c5ce7;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.style-icon {
    font-size: 2.5rem;
}

.style-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.style-desc {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-align: center;
}

/* 폼 액션 버튼 컨테이너 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

/* 제출 버튼 */
.submit-btn {
    flex: 1;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 초기화 버튼 */
.reset-btn {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c5ce7;
    background: #fff;
    border: 2px solid #6c5ce7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reset-btn:hover {
    background: #f8f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.reset-btn:active {
    transform: translateY(0);
}

/* 버튼 아이콘과 텍스트 */
.btn-icon {
    font-size: 1.3rem;
}

.btn-text {
    font-size: inherit;
}

/* ============================================
   결과 화면 스타일
   ============================================ */
.naming-results {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

/* 사주 요약 카드 */
.saju-summary-card {
    background: linear-gradient(135deg, #667eea20, #764ba220);
    border: 2px solid #6c5ce7;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

.saju-summary-card h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.saju-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.saju-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: white;
    border-radius: 12px;
}

.saju-item .label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

.saju-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
}

.saju-item .value.lacking {
    color: #e74c3c;
}

.saju-note {
    font-size: 1rem;
    color: #34495e;
    line-height: 1.6;
}

/* 결과 타이틀 */
.results-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

/* 이름 카드 */
.name-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    transition: all 0.3s;
}

.name-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.name-card.rank-1 {
    border-color: #f39c12;
    background: linear-gradient(to bottom, #fff9e6, white);
}

.name-card.rank-2 {
    border-color: #bdc3c7;
    background: linear-gradient(to bottom, #f5f5f5, white);
}

.name-card.rank-3 {
    border-color: #e67e22;
    background: linear-gradient(to bottom, #fff3e6, white);
}

/* 이름 헤더 */
.name-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.rank-badge {
    font-size: 2rem;
    font-weight: 700;
}

.name-display {
    flex: 1;
    text-align: center;
}

.name-display .hanja {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    display: block;
}

.name-display .korean {
    font-size: 1.3rem;
    color: #7f8c8d;
    display: block;
    margin-top: 8px;
}

.total-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    color: white;
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
}

.score-label {
    font-size: 0.9rem;
}

/* 점수 차트 */
.score-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.score-bar {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.score-bar .label {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.bar-container {
    height: 28px;
    background: #ecf0f1;
    border-radius: 14px;
    overflow: hidden;
}

.bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    transition: width 0.8s ease-out;
}

.bar-element {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.bar-stroke {
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
}

.bar-yinyang {
    background: linear-gradient(90deg, #e74c3c, #fd79a8);
}

.bar-phonetic {
    background: linear-gradient(90deg, #f39c12, #fdcb6e);
}

.bar-meaning {
    background: linear-gradient(90deg, #3498db, #74b9ff);
}

.bar .bar-label {
    font-size: 0.85rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.score-bar .value {
    text-align: right;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 700;
}

/* 토글 버튼 */
.toggle-details-btn {
    width: 100%;
    padding: 14px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #6c5ce7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.toggle-details-btn:hover {
    background: #6c5ce720;
    border-color: #6c5ce7;
}

.toggle-icon {
    transition: transform 0.3s;
}

/* 상세 분석 섹션 */
.analysis-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.analysis-section {
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #6c5ce7;
    border-radius: 8px;
}

.analysis-section h4 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 16px;
    font-weight: 700;
}

.analysis-section p {
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 10px;
}

.analysis-section p strong {
    color: #6c5ce7;
    font-weight: 700;
}

/* 획수 분석 */
.stroke-breakdown {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stroke-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.stroke-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stroke-label {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.95rem;
}

.stroke-value {
    color: #6c5ce7;
    font-weight: 700;
    font-size: 0.95rem;
}

.luck-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.luck-excellent {
    background: #d4edda;
    color: #155724;
}

.luck-good {
    background: #d1ecf1;
    color: #0c5460;
}

.luck-normal {
    background: #fff3cd;
    color: #856404;
}

.luck-bad {
    background: #f8d7da;
    color: #721c24;
}

.luck-terrible {
    background: #dc3545;
    color: white;
}

.stroke-desc {
    font-size: 0.95rem;
    color: #7f8c8d;
    line-height: 1.5;
}

/* 오행 분석 */
.element-info p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #2c3e50;
    font-size: 0.95rem;
}

.element-info p strong {
    color: #6c5ce7;
    font-weight: 700;
}

.element-comment {
    margin-top: 15px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-left: 4px solid #6c5ce7;
    border-radius: 6px;
    font-style: italic;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.6;
}

/* 음양 분석 */
.yinyang-pattern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.yinyang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    min-width: 80px;
}

.yinyang-item.yang {
    border: 3px solid #e74c3c;
}

.yinyang-item.yin {
    border: 3px solid #3498db;
}

.yinyang-label {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.yinyang-symbol {
    font-size: 1.5rem;
    font-weight: 700;
}

.yinyang-item.yang .yinyang-symbol {
    color: #e74c3c;
}

.yinyang-item.yin .yinyang-symbol {
    color: #3498db;
}

.arrow {
    font-size: 1.5rem;
    color: #bdc3c7;
}

.yinyang-comment {
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #34495e;
}

/* 발음 분석 */
.pronunciation {
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.romanization {
    font-size: 1.3rem;
    font-weight: 600;
    color: #6c5ce7;
    margin-bottom: 12px;
}

.phonetic-comment {
    font-size: 0.95rem;
    color: #7f8c8d;
    line-height: 1.5;
}

/* 의미 해석 */
.meaning-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.hanja-meaning {
    display: grid;
    grid-template-columns: 60px 80px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.hanja-char {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
}

.hanja-reading {
    font-size: 1.1rem;
    color: #6c5ce7;
    font-weight: 600;
}

.hanja-meaning-text {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

.combined-meaning {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #6c5ce7;
    font-size: 1rem;
    color: #2c3e50;
    line-height: 1.6;
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.button {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.button.secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
}

.button.secondary:hover {
    background: #bdc3c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
    .naming-container {
        padding: 20px;
    }

    .naming-header h1 {
        font-size: 2rem;
    }

    .radio-group {
        grid-template-columns: 1fr;
    }

    .date-input-group {
        grid-template-columns: 1fr 1fr;
    }

    .style-grid {
        grid-template-columns: 1fr;
    }

    .name-header {
        flex-direction: column;
        gap: 16px;
    }

    .score-bar {
        grid-template-columns: 90px 1fr;
    }

    .score-bar .value {
        display: none;
    }

    .hanja-meaning {
        grid-template-columns: 50px 1fr;
    }

    .hanja-reading {
        display: none;
    }
}

/* ============================================
   결과 액션 버튼 (공유, 인쇄)
   ============================================ */
.result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: #6366F1;
    color: #6366F1;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.1);
}

.action-btn svg {
    flex-shrink: 0;
}

.share-btn:hover svg {
    stroke: #6366F1;
}

.print-btn:hover svg {
    stroke: #6366F1;
}

/* 링크 복사 성공 알림 */
.copy-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    background: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    font-weight: 500;
    z-index: 9999;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .result-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }

    .action-btn span {
        font-size: 0.9rem;
    }
}

/* 인쇄 스타일 */
@media print {
    .result-actions {
        display: none !important;
    }

    .top-nav-bar,
    .footer,
    .hamburger-btn {
        display: none !important;
    }

    .naming-results {
        box-shadow: none !important;
    }

    .name-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
    }
}
