/* Digital Signature Styles */
.signature-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* PC에서 탭 중앙 정렬 */
.signature-tabs.centered-tabs {
    justify-content: center;
}

@media (max-width: 768px) {
    .signature-tabs.centered-tabs {
        justify-content: stretch;
    }
}

.tab-button {
    background: transparent;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background-color: #f8f9fa;
    color: #333;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 서명하기 탭 스타일 */
.draw-section {
    text-align: center;
}

.draw-instruction {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
}

.signature-canvas-container {
    position: relative;
    display: inline-block;
    border: 3px dashed #ddd;
    border-radius: 12px;
    background: white;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#signature-canvas {
    cursor: crosshair;
    background: transparent;
    border-radius: 8px;
}

.canvas-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 50px; /* 프로그램 설명과의 간격 추가 */
}

/* 서명 만들기 탭 스타일 */
.create-section {
    max-width: 800px;
    margin: 0 auto;
}

.language-selector {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.language-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    transition: color 0.3s ease;
}

.language-selector input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.language-selector label:hover {
    color: #667eea;
}

.name-input-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

#signature-name {
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    min-width: 250px;
    text-align: center;
    transition: all 0.3s ease;
}

#signature-name:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 서명 디자인 목록 */
.signature-designs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.signature-design {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.signature-design:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.signature-design.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
}

.signature-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.signature-text {
    font-size: 32px;
    color: #333;
    white-space: nowrap;
}

/* 다양한 서명 스타일 */
.signature-style-1 { font-family: 'Noto Serif KR', serif; font-weight: 600; }
.signature-style-2 { font-family: 'Dancing Script', cursive; font-weight: 700; }
.signature-style-3 { font-family: 'Nanum Pen Script', cursive; }
.signature-style-4 { font-family: 'Stylish', cursive; font-weight: 400; }
.signature-style-5 { font-family: 'Hi Melody', cursive; font-weight: 400; }

/* 영어 서명 스타일 */
.signature-style-en-1 { font-family: 'Pacifico', cursive; }
.signature-style-en-2 { font-family: 'Dancing Script', cursive; font-weight: 700; }
.signature-style-en-3 { font-family: 'Great Vibes', cursive; }
.signature-style-en-4 { font-family: 'Satisfy', cursive; }
.signature-style-en-5 { font-family: 'Allura', cursive; }

.design-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.download-design-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.signature-design:hover .download-design-btn {
    opacity: 1;
    transform: translateY(0);
}

.download-design-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 버튼 스타일 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .signature-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-button {
        width: 100%;
        border-radius: 8px;
    }
    
    .signature-canvas-container {
        padding: 10px;
    }
    
    #signature-canvas {
        width: 100%;
        max-width: 500px;
        height: 250px;
    }
    
    .canvas-controls {
        flex-direction: row; /* 가로 배치로 변경 */
        justify-content: center; /* 중앙 정렬 유지 */
        gap: 10px;
        flex-wrap: wrap; /* 화면이 작을 때 줄바꿈 */
        margin-bottom: 30px; /* 모바일에서도 하단 간격 추가 */
    }
    
    .canvas-controls .btn {
        min-width: 120px; /* 최소 너비 설정 */
        padding: 12px 20px; /* 적절한 패딩 */
        flex: 0 1 auto; /* 유연한 크기 조정 */
    }
    
    .language-selector {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .name-input-section {
        flex-direction: column;
        gap: 15px;
    }
    
    #signature-name {
        min-width: auto;
        width: 100%;
    }
    
    .signature-designs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .signature-text {
        font-size: 24px;
    }
}

/* 로딩 애니메이션 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 성공 메시지 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
    display: none;
    animation: slideDown 0.3s ease-out;
}

/* 입력 경고 메시지 */
.input-warning {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 16px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #f1aeb5;
    font-size: 14px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Digital Signature Information Section */
.info-section {
    background: #f8f9fa;
    padding: 60px 0;
    margin-top: 40px;
}

.info-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.info-header {
    text-align: center;
    margin-bottom: 50px;
}

.info-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.info-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

.white-text {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* 4칸럼 가로 레이아웃 (PC만) */
.info-grid.four-columns {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .info-grid.four-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .info-grid.four-columns {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: fit-content;
}

/* 4칸럼 레이아웃에서 카드 크기 조정 */
.four-columns .info-card {
    padding: 25px;
    font-size: 0.9rem;
}

.four-columns .info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.info-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card h3 i {
    color: #667eea;
    font-size: 1.2rem;
}

.info-card p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card ul li {
    padding: 8px 0;
    color: #555;
    line-height: 1.6;
}

.info-card ul li strong {
    color: #667eea;
}

/* Usage Steps */
.usage-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.four-columns .usage-steps {
    gap: 15px;
}

.four-columns .step-number {
    width: 25px;
    height: 25px;
    font-size: 12px;
}

.four-columns .step-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.four-columns .step-content p {
    font-size: 0.85rem;
    line-height: 1.5;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 14px;
}

.step-content h4 {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.step-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.four-columns .tips-grid {
    grid-template-columns: 1fr;
    gap: 15px;
}

.four-columns .tip-item {
    padding: 12px;
}

.four-columns .tip-item h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.four-columns .tip-item p {
    font-size: 0.8rem;
}

.tip-item {
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.tip-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.tip-item h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.tip-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Security Card */
.security-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    border: 2px solid #667eea;
}

.security-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.four-columns .security-features {
    gap: 15px;
}

.four-columns .security-item i {
    font-size: 1.2rem;
    width: 35px;
}

.four-columns .security-item h4 {
    font-size: 1rem;
    margin-bottom: 3px;
}

.four-columns .security-item p {
    font-size: 0.8rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.security-item i {
    color: #667eea;
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.security-item h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
}

.security-item p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

/* FAQ Section */
.faq-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.faq-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.faq-item {
    padding: 20px;
    border-radius: 10px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
}

.faq-item h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.cta-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
}

.cta-section p {
    margin: 0 0 25px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.cta-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    background: #f8f9fa;
}

/* Responsive Design for Info Section */
@media (max-width: 768px) {
    .info-section {
        padding: 40px 0;
    }
    
    .info-header h2 {
        font-size: 2rem;
    }
    
    .info-subtitle {
        font-size: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-card {
        padding: 20px;
    }
    
    .usage-steps {
        gap: 15px;
    }
    
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .security-features {
        gap: 15px;
    }
    
    .security-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .faq-section {
        padding: 25px;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-section {
        padding: 30px 20px;
    }
    
    .cta-section h3 {
        font-size: 1.4rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}