.upload-section {
    margin-top: 50px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
    border: 1px solid var(--border);
    text-align: center;
    color: var(--text-primary);
}

.file-label {
    cursor: pointer;
    display: inline-block;
    margin-bottom: 15px;
}

.file-label input[type="file"] {
    display: none;
}

.file-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 10px 26px rgba(211,47,47,0.28);
}

.drop-zone {
    border: 2px dashed rgba(211,47,47,0.35);
    border-radius: 14px;
    padding: 20px;
    margin: 12px 0 18px;
    color: var(--text-muted);
    background: var(--bg-section);
    transition: border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.local-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    margin: 10px 0 20px;
}

.local-copy { text-align: left; }
.local-title { font-weight: 700; color: var(--accent); }
.local-sub { color: #fff; font-size: 0.9rem; }

.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { display: none; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-elevated); transition: .3s; border-radius: 28px; border: 1px solid var(--border);
}
.slider:before {
  position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px;
  background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: linear-gradient(135deg,var(--accent),var(--accent-hover)); }
.switch input:checked + .slider:before { transform: translateX(24px); }

.config-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
    margin-bottom: 20px;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-heading);
}

.form-group input[type="range"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.position-option {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    background: var(--bg-section);
    color: var(--text-primary);
}

.position-option:hover {
    border-color: var(--accent);
    background: var(--bg-elevated);
}

.position-option.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
}

.preview-container {
    background: var(--bg-section);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

#previewCanvas {
    max-width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
    background: var(--bg-card);
}

.watermark-preview {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

#watermarkPreviewImg {
    max-width: 200px;
    border: 2px dashed rgba(211,47,47,0.45);
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-section);
}

.files-list {
    text-align: left;
    margin: 20px 0;
}

.file-item {
    background: var(--bg-section);
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.download-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-section);
    border-radius: 12px;
    border: 1px solid rgba(46,125,50,0.35);
    color: var(--text-primary);
}

.download-actions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.btn {
    background: var(--bg-elevated);
    color: #fff;
    padding: 12px 25px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 5px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: var(--bg-elevated);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #3fa34a);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f2b90c);
    color: #1a1a1a;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    transition: all 0.3s;
}

.btn-share {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

.btn-share::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 12px;
    border: 1px solid rgba(211,47,47,0.45);
    opacity: 0;
    pointer-events: none;
    animation: sharePulse 2.6s ease-out infinite;
}

.btn-share::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}

.btn-share:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.btn-share svg {
    width: 22px;
    height: 22px;
}

@keyframes sharePulse {
    0% { transform: scale(0.95); opacity: 0; }
    15% { opacity: 0.8; }
    100% { transform: scale(1.25); opacity: 0; }
}

.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    backdrop-filter: blur(6px);
}

.share-modal[hidden] {
    display: none;
}

.share-dialog {
    background: linear-gradient(135deg, #161B22 0%, #111827 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px;
    width: min(460px, 92vw);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    color: var(--text-primary);
    position: relative;
}

.share-dialog h3 {
    margin: 0 0 8px 0;
    color: var(--text-heading);
    font-size: 1.25rem;
}

.share-subtext {
    color: var(--text-muted);
    margin: 0 0 18px 0;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.share-note {
    margin-top: 18px;
    padding: 12px 14px;
    background: rgba(31, 41, 55, 0.7);
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.share-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.share-copy {
    width: 42px;
    height: 42px;
}

.share-icon-btn svg {
    width: 20px;
    height: 20px;
}

.share-icon-btn:hover {
    color: #fff;
    border-color: rgba(211,47,47,0.5);
    box-shadow: 0 10px 24px rgba(211,47,47,0.2);
    transform: translateY(-2px);
}

.share-icon-btn.is-copied::after {
    content: 'Copied';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 0.8rem;
    opacity: 1;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    pointer-events: none;
}

.share-bmc-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.share-bmc {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 14px 32px rgba(211,47,47,0.4);
    overflow: hidden;
}

.share-bmc::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    border: 1px solid rgba(211,47,47,0.45);
    opacity: 0;
    animation: sharePulse 2.8s ease-out infinite;
}

.share-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.share-close:hover {
    background: var(--bg-card);
}

.pdf-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 20, 25, 0.82);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.pdf-loading[hidden] {
    display: none;
}

.pdf-loading-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
    border: 1px solid rgba(211, 47, 47, 0.35);
    border-radius: 999px;
    padding: 12px 18px;
    color: var(--text-primary);
    box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 0 28px rgba(211,47,47,0.25);
}

.pdf-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(211,47,47,0.25);
    border-top-color: var(--accent);
    box-shadow: 0 0 12px rgba(211,47,47,0.55);
    animation: pdfSpinner 0.9s linear infinite;
}

.pdf-loading-text {
    font-size: 0.98rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

@keyframes pdfSpinner {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .btn-share::after {
        white-space: normal;
        width: 200px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-share::before {
        animation: none;
    }
    .pdf-spinner {
        animation: none;
    }
    .share-bmc::before {
        animation: none;
    }
}

.slider-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    color: var(--accent);
}

.helper-text {
    color: var(--text-muted);
    margin-top: 10px;
}

.upload-error {
    margin: 12px auto 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(198, 40, 40, 0.5);
    background: rgba(198, 40, 40, 0.12);
    color: #FECACA;
    font-size: 0.95rem;
    max-width: 560px;
}

/* Content Section Styles */
.content-section { background:var(--bg-card); padding:40px; border-radius:16px; margin:30px 0; box-shadow:0 18px 44px rgba(0,0,0,0.45); border:1px solid var(--border); }
.content-section h2 { color:var(--text-heading); margin-bottom:20px; font-size:1.8rem; }
.content-section p { color:var(--text-muted); line-height:1.8; margin-bottom:15px; }

.steps-guide { display:flex; flex-direction:column; gap:20px; margin:25px 0; }
.step-item { display:flex; gap:20px; align-items:flex-start; }
.step-num { background:linear-gradient(135deg,var(--accent),var(--accent-hover)); color:#fff; width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0; }
.step-content h3 { color:var(--text-heading); margin-bottom:8px; }
.step-content p { color:var(--text-muted); margin:0; }

.features-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:25px; margin:25px 0; justify-items:center; }
.feature-card { background:var(--bg-section); padding:25px; border-radius:12px; border:1px solid var(--border); border-left:4px solid var(--accent); display:flex; flex-direction:column; align-items:center; text-align:center; }
.feature-icon { width: 40px; height: 40px; margin-bottom: 10px; }
.feature-card h3 { color:var(--text-heading); margin-bottom:10px; font-size:1.1rem; }
.feature-card p { color:var(--text-muted); margin:0; font-size:0.95rem; }

.use-cases-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:15px; margin:25px 0; }
.use-case-item { background:var(--bg-section); padding:15px 20px; border-radius:8px; color:var(--text-primary); font-weight:500; border:1px solid var(--border); }

.tips-container { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; margin:25px 0; }
.tip-box { background:var(--bg-section); padding:20px; border-radius:12px; border:1px solid var(--border); }
.tip-box h4 { color:var(--text-heading); margin-bottom:10px; }
.tip-box p { color:var(--text-muted); margin:0; font-size:0.95rem; }

.faq-container { margin:25px 0; }
.faq-item { background:var(--bg-section); padding:20px; border-radius:12px; margin-bottom:15px; border:1px solid var(--border); }
.faq-item h3 { color:var(--text-heading); margin-bottom:10px; font-size:1.1rem; }
.faq-item p { color:var(--text-muted); margin:0; }

.cta-section { background:linear-gradient(135deg,var(--accent),var(--accent-hover)); color:#fff; padding:40px; border-radius:16px; text-align:center; margin:30px 0; }
.cta-section h2 { margin-bottom:15px; }
.cta-section p { opacity:0.9; margin-bottom:20px; }
.cta-btn { background:#fff; color:#7f1d1d; padding:12px 30px; border-radius:25px; text-decoration:none; font-weight:600; display:inline-block; }

.related-tools { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:15px; margin:25px 0; }
.related-tool-link { background:var(--bg-section); padding:15px; border-radius:8px; text-decoration:none; color:var(--text-primary); text-align:center; transition:all 0.3s; border:1px solid var(--border); }
.related-tool-link:hover { background:var(--bg-elevated); color:var(--text-heading); transform:translateY(-3px); border-color:var(--accent); }

@media(max-width:768px) {
    .content-section { padding:25px; }
    .step-item { flex-direction:column; gap:10px; }
    .features-grid, .tips-container { grid-template-columns:1fr; }
}
