:root {
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --primary-color: #dc2626;
    --text-main: #111827;
    --text-muted: #4b5563;
    --transition-smooth: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, background-color 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Glow Orbs */
.glow-orb {
    position: fixed;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}

.orb-1 {
    top: -60px;
    left: -60px;
    background: rgba(220, 38, 38, 0.04);
}

.orb-2 {
    bottom: -60px;
    right: -60px;
    background: rgba(185, 28, 28, 0.03);
}

/* Header Style with increased max-width and minimal edge margin */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    max-width: 920px;
    margin: 0 auto;
}

.nav-container {
    width: 100%;
    padding: 0 8px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.highlight {
    color: var(--primary-color);
}

.about-btn {
    width: 36px;
    height: 36px;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.about-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: scale(1.05);
}

/* GitHub Trust Badge Card */
.hero-github-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: var(--transition-smooth);
    width: 100%;
    max-width: 380px;
}

.hero-github-card:hover {
    border-color: #fca5a5;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.06);
}

.github-card-icon {
    font-size: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.github-card-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.github-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    white-space: normal;
}

.github-card-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
    line-height: 1.3;
    white-space: normal;
}

/* Main Container & Tool Card with expanded width and reduced side margins */
.main-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 16px 6px;
}

.tool-app-card {
    background: var(--card-bg);
    padding: 16px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

details.tool-app-card summary::-webkit-details-marker {
    display: none;
}

details.format-notice {
    margin-bottom: 12px;
    font-size: 11px;
    color: #7f1d1d;
    background: #fef2f2;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px dashed #f87171;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

details.format-notice summary {
    font-weight: 600;
    outline: none;
}

.format-details {
    margin-top: 4px;
    font-size: 10px;
    color: #4b5563;
    border-top: 1px solid #fecaca;
    padding-top: 4px;
    line-height: 1.3;
}

.upload-box {
    border: 2px dashed #f87171;
    padding: 16px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fffdfd;
    text-align: center;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background: #fff5f5;
}

.upload-icon {
    margin-bottom: 4px;
}

input[type="file"] {
    display: none;
}

.upload-label {
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
    display: block;
}

.upload-label strong {
    color: var(--primary-color);
}

/* File Preview Section */
.file-preview-container {
    margin-top: 10px;
    text-align: left;
    background: #fff5f5;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.file-info-card {
    display: flex;
    align-items: center;
    gap: 8px;
}

#previewThumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #fca5a5;
}

.file-details span {
    display: block;
    font-size: 11px;
    color: #1f2937;
}

.file-details span#fileNameDisplay {
    font-weight: 600;
    word-break: break-all;
}

#status {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Scrollable Output Box */
.result-box {
    margin-top: 10px;
    text-align: left;
    background: #fffbfb;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    display: none;
    max-height: 180px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #fee2e2;
}

.result-box::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.result-box::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.result-box h4 {
    font-size: 11px;
    color: #991b1b;
    margin-bottom: 4px;
    font-weight: 700;
}

.result-box ul {
    list-style-type: disc;
    padding-left: 14px;
    font-size: 11px;
    color: #374151;
}

.result-box li {
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.3;
}

.download-btn {
    display: none;
    margin-top: 12px;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.download-btn:hover {
    background-color: #b91c1c;
}

/* Serverless Performance Disclaimer Box Style */
.disclaimer-box {
    margin-top: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    color: #92400e;
    text-align: left;
    line-height: 1.4;
}

.disclaimer-box i {
    color: #d97706;
    font-size: 13px;
    margin-top: 1px;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #fca5a5;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* FAQ Section Styling matched to tool card width */
.faq-section {
    width: 100%;
    margin: 35px 0 0 0;
    padding: 0;
}

.faq-container {
    width: 100%;
}

.faq-container h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 16px;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
    transition: var(--transition-smooth);
}

.faq-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.05);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 13px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    gap: 12px;
}

.faq-question span {
    flex: 1;
}

.faq-question i {
    color: var(--primary-color);
    font-size: 0.75rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}

.faq-item.active .faq-answer {
    grid-template-rows: 1fr;
    padding: 0 16px 14px 16px;
}

.faq-answer > div {
    overflow: hidden;
}

.faq-answer p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* Footer Style */
.app-footer {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 36px 0 20px 0;
    margin: 45px auto 0 auto;
    max-width: 920px;
    color: var(--text-muted);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.footer-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px;
}

.footer-container {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 30px;
    width: 100%;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.footer-col {
    width: 100%;
    text-align: left;
}

.footer-tools-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

.footer-col h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.footer-col h4 {
    font-size: 0.86rem;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-col p {
    font-size: 0.78rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.footer-social-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.github-btn {
    width: auto;
    padding: 0 14px;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

.social-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    transform: translateY(-1px);
}

.footer-tools-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-tools-list li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.15s ease;
    display: inline-block;
}

.footer-tools-list li a:hover {
    color: var(--primary-color);
}

.footer-links-bar {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.78rem;
}

.footer-links-container a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 2px 4px;
    white-space: nowrap;
}

.footer-links-container a:hover {
    color: var(--primary-color);
}

.footer-links-container span {
    color: var(--border-color);
}

.footer-bottom {
    margin-top: 14px;
    text-align: center;
    font-size: 0.74rem;
    padding: 0 10px;
}

/* Mobile Responsive Truncation for GitHub Card */
@media (max-width: 768px) {
    .github-card-title,
    .github-card-desc {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Responsive Footer adjustments for Mobile */
@media (max-width: 950px) {
    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
    }
    .footer-tools-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
        width: 100%;
    }
    .footer-col {
        text-align: center;
    }
    .footer-social-links {
        justify-content: center;
    }
    .footer-links-container {
        flex-direction: column;
        gap: 8px;
    }
    .footer-links-container span {
        display: none;
    }
}
