/**
 * ===========================================
 * Repost - index.html 전용 스타일
 * ===========================================
 * 
 * 메인 페이지 전용 스타일 (헤더/풋터는 base.html에서 관리)
 * 
 * @version 2.0.0
 * @author Repost Team
 */

/* ===========================================
   1. 메인 페이지 전용 배경
   =========================================== */
body {
    background: 
        radial-gradient(at 27% 37%, rgba(102, 126, 234, 0.8) 0px, transparent 50%),
        radial-gradient(at 97% 21%, rgba(125, 235, 200, 0.7) 0px, transparent 50%),
        radial-gradient(at 52% 99%, rgba(244, 107, 153, 0.7) 0px, transparent 50%),
        radial-gradient(at 10% 29%, rgba(118, 75, 162, 0.8) 0px, transparent 50%),
        #1a1a2e;
    background-attachment: fixed;
}

.container {
    background: transparent;
    max-width: min(900px, 100vw);
    width: 100%;
    padding: 0 40px 30px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
}

/* ===========================================
   2. 메인 헤더 섹션
   =========================================== */
.header {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: clamp(1.8em, 5vw, 2.5em);
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    word-break: keep-all;
    letter-spacing: -0.02em;
    animation: fadeInDown 0.8s ease-out 0.2s backwards;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.header .tagline {
    font-size: clamp(1.2em, 3.5vw, 1.7em);
    color: white;
    font-weight: 700;
    margin-bottom: 12px;
    word-break: keep-all;
    line-height: 1.4;
    animation: fadeInDown 0.8s ease-out 0.4s backwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header .subtitle {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1em, 2.5vw, 1.2em);
    line-height: 1.6;
    word-break: keep-all;
    font-weight: 600;
    animation: fadeInDown 0.8s ease-out 0.6s backwards;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===========================================
   3. 컨텐츠 래퍼
   =========================================== */
.content-wrapper {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 30px;
    padding: 35px;
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: fadeInUp 0.8s ease-out 0.8s backwards;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    /* GPU 가속 */
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%
    );
}

/* ===========================================
   4. 기능 카드
   =========================================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.95) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out backwards;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    /* GPU 가속 */
    transform: translate3d(0, 0, 0);
}

.feature-card:nth-child(1) { animation-delay: 0.8s; }
.feature-card:nth-child(2) { animation-delay: 1s; }
.feature-card:nth-child(3) { animation-delay: 1.2s; }

.feature-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(248, 250, 252, 1) 100%
    );
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.35);
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
}

.feature-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.feature-desc {
    font-size: 0.9em;
    color: #4a5568;
    line-height: 1.5;
    font-weight: 500;
}

/* ===========================================
   5. 섹션 헤더
   =========================================== */
.section-header {
    text-align: center;
    margin: 25px 0;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.section-description-large {
    font-size: clamp(0.95em, 2.5vw, 1.05em);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.highlight-ai {
    color: #ec4899;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(236, 72, 153, 0.5);
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline;
    }
}

/* ===========================================
   6. 입력 섹션
   =========================================== */
.input-section {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.reset-btn {
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #f46b99 0%, #ec4899 50%, #f43f5e 100%) !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(244, 107, 153, 0.4);
    position: relative;
    overflow: hidden;
    filter: brightness(1);
}

.reset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.reset-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.reset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 35px rgba(244, 107, 153, 0.6);
    filter: brightness(1.1);
}

.reset-btn:hover svg {
    transform: rotate(180deg);
}

.reset-btn:active {
    transform: scale(0.95);
}

input[type="text"] {
    flex: 1;
    padding: 20px 28px;
    border: none;
    border-radius: 50px;
    font-size: clamp(0.95em, 3vw, 1.1em);
    transition: all 0.3s ease;
    min-width: 0;
    width: 100%;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

input[type="text"]::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-weight: 400;
}

/* 모바일에서 placeholder 글자 크기 줄여서 더 많이 보이게 */
@media (max-width: 768px) {
    input[type="text"]::placeholder {
        font-size: 0.75rem;
    }
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.3);
    background: white;
    transform: translateY(-2px);
}

input[type="text"]::placeholder {
    color: #a0aec0;
}

button {
    padding: 20px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: clamp(0.95em, 3vw, 1.1em);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 60px;
    touch-action: manipulation;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===========================================
   7. 로딩 섹션
   =========================================== */
.loading {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.loading.show {
    display: block;
}

.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.cute-robot {
    font-size: 3em;
    animation: bounce 1s ease-in-out infinite;
}

.thinking-dots {
    display: flex;
    gap: 8px;
}

.thinking-dots span {
    font-size: 1.5em;
    animation: float 1.5s ease-in-out infinite;
    opacity: 0;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.3s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.6s;
}

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

.loading-progress {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progress 2s ease-in-out infinite;
    width: 0%;
    transition: width 0.5s ease;
}

@keyframes progress {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.loading-step {
    color: #667eea;
    font-size: 1.1em;
    font-weight: 600;
    margin: 10px 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-tip {
    color: #999;
    font-size: 0.9em;
    margin-top: 15px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    max-width: 400px;
    margin: 15px auto 0;
}

/* ===========================================
   8. 블로그 정보 & 댓글 섹션
   =========================================== */
.blog-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    overflow-wrap: break-word;
    word-break: break-word;
}

.blog-info.show {
    display: block;
}

.blog-info h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: clamp(1.1em, 4vw, 1.3em);
    word-break: keep-all;
}

.blog-info p {
    color: #666;
    line-height: 1.6;
    font-size: clamp(0.9em, 3vw, 1em);
}

.comments-section {
    display: none;
}

.comments-section.show {
    display: block;
}

.comments-header {
    font-size: clamp(1.1em, 4vw, 1.3em);
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.comment-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.15);
    padding: 18px 22px;
    border-radius: 15px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.comment-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.comment-item:active {
    transform: translateY(0);
}

.comment-text {
    color: #2d3748;
    font-size: 1em;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.copy-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
    font-weight: 600;
    touch-action: manipulation;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.copy-btn.copied {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.error.show {
    display: block;
}

.go-to-blog-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: clamp(1em, 4vw, 1.1em);
    font-weight: bold;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: none;
    min-height: 56px;
    touch-action: manipulation;
}

.go-to-blog-btn.show {
    display: block;
}

.go-to-blog-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.go-to-blog-btn span {
    margin-left: 8px;
    font-size: 1.2em;
}

/* ===========================================
   9. 반응형 (모바일)
   =========================================== */
@media (max-width: 768px) {
    body {
        padding-top: 0;
        /* 모바일 스크롤 최적화 */
        -webkit-overflow-scrolling: touch;
    }

    .container {
        padding: 30px 20px 35px;
        margin: 0 auto;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    /* 모바일 성능 최적화: backdrop-filter 대폭 축소 */
    .content-wrapper {
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
        background: rgba(255, 255, 255, 0.5);
        /* GPU 가속 강제 */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    .feature-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        /* GPU 가속 */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    .comment-item {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.95);
    }

    .header h1 {
        font-size: clamp(2em, 8vw, 2.8em);
    }
    
    .header .tagline {
        font-size: clamp(1.1em, 4vw, 1.4em);
    }
    
    .header .subtitle {
        font-size: clamp(0.95em, 3vw, 1.1em);
    }
    
    .input-section {
        margin-bottom: 20px;
        padding: 25px 20px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 2em;
    }

    .comment-item {
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 25px 20px;
    }

    .content-wrapper {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .feature-desc br {
        display: none;
    }

    .input-group {
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }

    input[type="text"] {
        padding: 17px 16px;
        width: 100%;
        flex: 1 1 100%;
        order: 1;
    }

    .reset-btn {
        width: 48px !important;
        min-width: 48px !important;
        height: 48px !important;
        flex: 0 0 48px !important;
        order: 2;
        border-radius: 50% !important;
        aspect-ratio: 1 / 1;
    }

    #analyzeBtn {
        flex: 1 !important;
        padding: 12px 20px;
        order: 3;
    }

    .blog-info {
        padding: 15px;
    }

    .go-to-blog-btn {
        padding: 16px;
        margin: 15px 0;
    }

    .comment-item {
        padding: 12px 15px;
        gap: 10px;
    }

    .comment-text {
        font-size: 0.9em;
        line-height: 1.4;
    }

    .copy-btn {
        padding: 8px 14px;
        font-size: 0.85em;
        min-height: 38px;
    }
}
