/* ============================================
   EasyPDF - Global Stylesheet
   Theme: Red (#ef4444 / #dc2626)
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f9fafb;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Home Header ---------- */
.home-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-header .logo {
    height: 36px;
    flex-shrink: 0;
}

.home-header .tagline {
    font-size: 0.9rem;
    color: #64748b;
    border-left: 1px solid #e5e7eb;
    padding-left: 1rem;
    white-space: nowrap;
}

/* ---------- Tool Header (sub pages) ---------- */
.tool-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tool-header .header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.tool-header .header-logo img {
    width: 28px;
    height: 28px;
}

.tool-header .header-logo span {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.tool-header .header-divider {
    width: 1px;
    height: 24px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.tool-header .tool-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.tool-header .tool-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tool-header .tool-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-header .btn-home {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.tool-header .btn-home:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

/* ---------- Main Content ---------- */
main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ---------- Intro Text ---------- */
.calc-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.calc-intro h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.calc-intro p {
    font-size: 0.95rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---------- Tool Grid ---------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ---------- Tool Card ---------- */
.tool-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #ef4444;
}

.tool-card .tool-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.tool-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.tool-card p {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* ---------- Tool Container (sub page wrapper) ---------- */
.tool-container {
    max-width: 700px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.tool-container h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.tool-container .tool-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-zone:hover {
    border-color: #ef4444;
    background: #fef2f2;
}

.upload-zone.drag-over {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #ef4444;
}

.upload-zone .upload-text {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.upload-zone .upload-text strong {
    color: #ef4444;
}

.upload-zone .upload-hint {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ---------- File List ---------- */
.file-list {
    list-style: none;
    margin: 1rem 0;
}

.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
}

.file-list .file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.file-list .file-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.file-list .file-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list .file-size {
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.file-list .btn-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-list .btn-remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    background: #ffffff;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid #ef4444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ---------- Result Box ---------- */
.result-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.result-box .result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.result-box .result-info {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.result-box .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.result-box .btn-download:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    margin-top: auto;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

footer .footer-links a {
    font-size: 0.8rem;
    color: #64748b;
    transition: color 0.2s;
}

footer .footer-links a:hover {
    color: #ef4444;
}

footer .copyright {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ---------- SEO Content ---------- */
.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.seo-content .seo-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin: 0 auto;
    font-family: inherit;
    transition: color 0.2s;
}

.seo-content .seo-toggle:hover {
    color: #64748b;
}

.seo-content .seo-toggle .arrow {
    transition: transform 0.2s;
    display: inline-block;
}

.seo-content .seo-toggle.active .arrow {
    transform: rotate(180deg);
}

.seo-content .seo-body {
    display: none;
    max-width: 800px;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
}

.seo-content .seo-body.show {
    display: block;
}

.seo-content .seo-body h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

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

.seo-content .seo-body p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.seo-content .seo-body .faq-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
}

.seo-content .seo-body .faq-item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.seo-content .seo-body .faq-item p {
    margin-bottom: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .home-header {
        padding: 0.75rem 1rem;
    }

    .home-header .logo {
        height: 30px;
    }

    .home-header .tagline {
        font-size: 0.8rem;
    }

    main {
        padding: 1.25rem 1rem;
    }

    .calc-intro h1 {
        font-size: 1.25rem;
    }

    .calc-intro p {
        font-size: 0.85rem;
    }

    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .tool-card {
        padding: 1.25rem 1rem;
        border-radius: 10px;
    }

    .tool-card .tool-icon {
        font-size: 2.25rem;
    }

    .tool-card h3 {
        font-size: 0.85rem;
    }

    .tool-card p {
        font-size: 0.75rem;
    }

    .tool-container {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .tool-header .header-logo span {
        display: none;
    }

    .tool-header .tool-title {
        font-size: 0.85rem;
    }

    footer .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .tool-card {
        padding: 1rem 0.75rem;
    }

    .tool-card .tool-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .home-header .tagline {
        display: none;
    }

    .tool-container {
        padding: 1rem;
        border-radius: 10px;
    }

    .upload-zone {
        padding: 1.5rem 1rem;
    }

    .upload-zone .upload-icon {
        font-size: 2rem;
    }

    .upload-zone .upload-text {
        font-size: 0.85rem;
    }

    .btn-primary {
        padding: 0.95rem 1rem;
        font-size: 1rem;
    }

    .btn-download, .btn-secondary {
        padding: 0.75rem 1rem;
    }

    .file-list li {
        padding: 0.6rem 0.75rem;
    }

    .file-list .file-name {
        max-width: 120px;
    }

    .file-list .file-size {
        font-size: 0.7rem;
    }

    .result-box {
        padding: 1.25rem;
    }

    .calc-intro h1 {
        font-size: 1.15rem;
    }

    footer {
        padding: 1.25rem 1rem;
    }

    footer .footer-links {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    footer .footer-links a {
        font-size: 0.8rem;
    }
}

/* ---------- Content Pages (Privacy, Terms, About) ---------- */
.content-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.content-page h1 {
    font-size: 1.75rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.content-page .last-updated {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.content-page section {
    margin-bottom: 2rem;
}

.content-page h2 {
    font-size: 1.2rem;
    color: #334155;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.content-page h3 {
    font-size: 1.05rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.content-page p {
    line-height: 1.8;
    color: #475569;
    margin-bottom: 0.75rem;
}

.content-page ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-page li {
    line-height: 1.8;
    color: #475569;
    margin-bottom: 0.25rem;
}

/* About page features */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .content-page {
        margin: 1rem;
        padding: 1.25rem;
    }
}
