/* Base Variables */
:root {
    --bg-main:         #ffffff;
    --bg-subtle:       #fcfaff;

    --text-primary:    #1f2937;
    --text-secondary:  #4b5563;
    --text-muted:      #9ca3af;
    
    /* PDF red-themed accents */
    --text-accent:     #dc2626; /* Crimson Red */
    --accent-light:    #f87171;
    --accent-dim:      rgba(220, 38, 38, 0.08);
    --accent-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);

    --card-bg:         #ffffff;
    --card-border:     #e5e7eb;

    --tool-card-bg:    #ffffff;

    --shadow-soft:     0 10px 30px rgba(220, 38, 38, 0.08);
    --shadow-hover:    0 20px 50px rgba(220, 38, 38, 0.14);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-subtle);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Typography */
.gradient-text {
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-red { color: #ef4444; }

.hero-section {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    animation: slideDown 0.8s ease-out forwards;
}

.main-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 2rem;
}

/* Blog button */
.top-nav {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.nav-blog-link {
    background: transparent;
    border: 2px solid var(--text-accent);
    color: var(--text-accent);
    padding: 10px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.nav-blog-link:hover {
    background: var(--text-accent);
    color: #ffffff;
}

/* Container */
.container {
    width: 100%;
    max-width: 950px;
    padding: 0 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

/* Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-light);
}

.tool-card {
    padding: 0;
    overflow: hidden;
}

/* Tabs */
.tabs-container {
    display: flex;
    overflow-x: auto;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--card-border);
}

.tabs-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-container::-webkit-scrollbar-thumb {
    background-color: var(--card-border);
    border-radius: 4px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.2rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.tab-btn:hover {
    color: var(--text-accent);
    background: var(--accent-dim);
}

.tab-btn.active {
    color: var(--text-accent);
    border-bottom-color: var(--text-accent);
    background: #ffffff;
}

/* Upload Area */
.upload-area {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--tool-card-bg);
}

.file-input {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--card-border);
    border-radius: 16px;
    padding: 3.5rem 2rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-subtle);
}

.upload-label:hover, .upload-label.dragover {
    border-color: var(--text-accent);
    background: var(--accent-dim);
}

.upload-icon {
    font-size: 4rem;
    color: var(--accent-light);
    margin-bottom: 1rem;
}

.upload-label h3 {
    font-size: 1.5rem;
    color: var(--text-accent);
    margin-bottom: 0.5rem;
}

.upload-label p {
    color: var(--text-secondary);
}

.format-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Workspace Area */
.workspace-area {
    padding: 2.5rem;
}

.workspace-layout {
    display: flex;
    gap: 2.5rem;
    flex-direction: row;
}

@media (max-width: 768px) {
    .workspace-layout {
        flex-direction: column;
    }
}

.hidden {
    display: none !important;
}

/* File List Preview Area */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--card-border);
}

.file-list-container {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

/* Custom Scrollbar for list container */
.file-list-container::-webkit-scrollbar {
    width: 6px;
}
.file-list-container::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border-radius: 3px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    cursor: grab;
    transition: var(--transition);
}

.file-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.file-icon {
    color: var(--text-accent);
    font-size: 1.8rem;
}

.file-details {
    flex-grow: 1;
    overflow: hidden;
}

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.file-remove:hover {
    color: var(--text-accent);
}

/* Privacy Notice */
.privacy-notice {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(220, 38, 38, 0.08); /* Light Red BG */
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    line-height: 1.4;
    color: var(--text-accent);
    font-weight: 600;
}

/* Right Column: Controls */
.controls-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-content {
    animation: fadeIn 0.4s ease-out;
}

.tab-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.help-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* UI Elements */
.control-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.ui-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--card-bg);
    outline: none;
    transition: var(--transition);
}

.ui-input:focus {
    border-color: var(--text-accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.ui-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Buttons */
.action-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.action-btn.full-width {
    width: 100%;
}

.action-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.35);
}

.action-btn:active {
    transform: translateY(1px);
}

.action-btn.success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.action-btn.success:hover {
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4);
}

.action-btn.outline-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--card-border);
    box-shadow: none;
    font-size: 0.95rem;
    padding: 0.8rem 1.5rem;
}

.action-btn.outline-btn:hover {
    background: var(--accent-dim);
    color: var(--text-accent);
    border-color: var(--text-accent);
    transform: translateY(0);
}

/* Tutorial Grid */
.tutorial-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.tutorial-card {
    flex: 1;
    min-width: 250px;
    max-width: 320px;
    position: relative;
    padding: 2.5rem 2rem;
    text-align: center;
}

.step-num {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.step-icon {
    color: var(--accent-light);
    margin-bottom: 1.2rem;
}

.tutorial-card h3 {
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.tutorial-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* SEO Content Section */
.secondary-card {
    padding: 3rem 2.5rem;
}

.secondary-card h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.secondary-card p {
    color: var(--text-secondary);
}

.secondary-card li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: var(--text-secondary);
}

.secondary-card li i {
    margin-top: 0.4rem;
    font-size: 1.2rem;
}

/* Ad Spaces */
.ad-space {
    background: var(--bg-subtle);
    border: 1px dashed var(--card-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.header-ad { width: 100%; max-width: 728px; height: 90px; margin-top: 1rem; border: none;}
.footer-ad { width: 100%; max-width: 728px; height: 90px; margin-bottom: 2rem; border: none;}
.side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    display: none;
    border: none;
}
.left-ad { left: 1rem; }
.right-ad { right: 1rem; }

/* Language Selector */
.language-selector-container {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.language-dropdown {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23dc2626%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.75rem auto;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.language-dropdown:hover {
    border-color: var(--text-accent);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.15);
}

/* Footer */
.main-footer {
    padding: 3rem 1.5rem;
    width: 100%;
    margin-top: auto;
    background: var(--bg-subtle);
    border-top: 1px solid var(--card-border);
}

.footer-content {
    max-width: 950px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text-accent);
}

.footer-links .separator {
    color: var(--card-border);
}

.social-links {
    display: flex;
    gap: 1.2rem;
    font-size: 1.2rem;
}

.social-links a {
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.social-links a:hover {
    color: #ffffff;
    background: var(--text-accent);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
}

.copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@media (min-width: 1400px) {
    .side-ad { display: flex; }
}

@media (max-width: 768px) {
    .glass-card { padding: 1.5rem; }
    .header-ad, .footer-ad { height: 100px; }
    .tabs-container { flex-wrap: nowrap; overflow-x: auto; }
}
