/**
 * WinApp Collection - 공통 스타일시트
 */

/* 리셋 및 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Malgun Gothic', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #eaeaea;
    min-height: 100vh;
    padding: 40px 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 50px;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #888;
    font-size: 1rem;
}

/* 앱 카드 그리드 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* 앱 카드 */
.app-card {
    background: #2d2d44;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.app-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-content {
    padding: 24px;
}

.app-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.app-description {
    font-size: 0.95rem;
    color: #aaa;
    line-height: 1.6;
}

.app-tag {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 14px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #667eea;
}

.app-version {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px;
    background: rgba(17, 153, 142, 0.2);
    border: 1px solid rgba(17, 153, 142, 0.3);
    border-radius: 12px;
    font-size: 0.75rem;
    color: #11998e;
}

/* 앱 상세 페이지 */
.app-hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px;
    background: #2d2d44;
    border-radius: 16px;
}

.app-hero-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.app-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.app-hero .subtitle {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* 다운로드 버튼 */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.5);
}

.btn-download .icon {
    font-size: 1.3rem;
}

.download-info {
    margin-top: 16px;
    font-size: 0.9rem;
    color: #888;
}

/* 섹션 */
.section {
    background: #2d2d44;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3d3d5c;
}

/* 기능 리스트 */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-text h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 0.85rem;
    color: #aaa;
}

/* 시스템 요구사항 */
.requirements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.requirement-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-align: center;
}

.requirement-item .label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.requirement-item .value {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 네비게이션 */
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.nav-back:hover {
    color: #667eea;
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #3d3d5c;
    color: #666;
    font-size: 0.9rem;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 가이드 페이지 */
.guide-content {
    background: #2d2d44;
    border-radius: 16px;
    padding: 40px;
}

.guide-content h2 {
    color: #11998e;
    font-size: 1.5rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3d3d5c;
}

.guide-content h2:first-child {
    margin-top: 0;
}

.guide-content h3 {
    color: #ffd166;
    font-size: 1.2rem;
    margin: 25px 0 15px;
}

.guide-content p {
    margin-bottom: 16px;
}

.guide-content ul, .guide-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.guide-content li {
    margin-bottom: 8px;
}

.guide-content code {
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

.guide-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.guide-content th, .guide-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #3d3d5c;
}

.guide-content th {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.guide-card {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.guide-warning {
    background: rgba(255, 209, 102, 0.15);
    border-left: 4px solid #ffd166;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.guide-info {
    background: rgba(102, 126, 234, 0.15);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

/* 스텝 표시 */
.step {
    display: flex;
    align-items: flex-start;
    margin: 15px 0;
}

.step-number {
    background: #667eea;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 15px;
}

.step-content {
    flex: 1;
}

/* 푸터 구분자 */
.footer-separator {
    margin: 0 10px;
    color: #4d4d6c;
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d2d44;
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* ========================================
   마크다운 렌더링 스타일 (가이드 페이지용)
   ======================================== */

.guide-container {
    max-width: 900px;
    margin: 0 auto;
}

.guide-content h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #3d3d5c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guide-content h4 {
    color: #aaa;
    margin-top: 20px;
    margin-bottom: 10px;
}

.guide-content pre {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.guide-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.85em;
}

.guide-content hr {
    border: none;
    border-top: 2px solid #3d3d5c;
    margin: 40px 0;
}

.guide-content strong {
    color: #fff;
}

.guide-content blockquote {
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 20px 0;
    color: #aaa;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 0 8px 8px 0;
}

.guide-content a {
    color: #667eea;
    text-decoration: none;
}

.guide-content a:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #888;
}

/* 플로팅 목차 */
.toc-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 48px;
    height: 48px;
    background: rgba(45, 45, 68, 0.95);
    color: #667eea;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.toc-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    background: rgba(102, 126, 234, 0.9);
    color: white;
}

.toc-toggle:active {
    transform: scale(0.95);
}

.toc-container {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 260px;
    max-height: 70vh;
    background: #2d2d44;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.toc-container.hide {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.toc-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.toc-list {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    max-height: calc(70vh - 50px);
    overflow-y: auto;
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: 10px 20px;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.toc-list a:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border-left-color: #667eea;
}

/* 반응형 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .app-hero {
        padding: 24px;
    }

    .section {
        padding: 20px;
    }

    .guide-content {
        padding: 24px;
    }

    .toc-toggle {
        right: 15px;
        top: 15px;
    }

    .toc-container {
        right: 15px;
        top: 75px;
        max-height: 50vh;
        width: 220px;
    }
}
