/* ========================================
   PDF Center — Page Styles
   ======================================== */

/* Hero merge animation */
.pdfc-merge-anim {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; padding: 20px; width: 100%; max-width: 420px; flex-wrap: wrap;
}

.pdfc-page {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 14px; background: #fff; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06); min-width: 64px;
}

.pdfc-pg-icon { font-size: 1.5rem; color: #ef4444; }
.pdfc-page span { font-size: 0.65rem; font-weight: 600; color: #64748b; }

.pdfc-p1 { animation: pdfcSlideL 2.5s 0.5s ease-in-out infinite; }
.pdfc-p2 { animation: pdfcSlideR 2.5s 0.5s ease-in-out infinite; }

@keyframes pdfcSlideL {
    0%, 30% { transform: translateX(0); } 50%, 70% { transform: translateX(20px); } 90%, 100% { transform: translateX(0); }
}
@keyframes pdfcSlideR {
    0%, 30% { transform: translateX(0); } 50%, 70% { transform: translateX(-20px); } 90%, 100% { transform: translateX(0); }
}

.pdfc-merge-arrow {
    font-size: 1.1rem; color: #f97316;
    animation: pdfcArrowPulse 2.5s 0.5s ease-in-out infinite;
}

@keyframes pdfcArrowPulse {
    0%, 30% { opacity: 0.3; transform: scale(0.8); }
    50%, 70% { opacity: 1; transform: scale(1.1); }
    90%, 100% { opacity: 0.3; transform: scale(0.8); }
}

.pdfc-result {
    border: 2px solid #10b981;
    animation: pdfcResultIn 2.5s 0.5s ease-in-out infinite;
}

@keyframes pdfcResultIn {
    0%, 40% { opacity: 0; transform: scale(0.8); }
    60%, 80% { opacity: 1; transform: scale(1); }
    95%, 100% { opacity: 0; transform: scale(0.8); }
}

/* ========================================
   Tool Grid
   ======================================== */
.pdfc-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.pdfc-tool {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.pdfc-tool::before {
    content: '';
    position: absolute;
    top: 0; left: 25%; right: 25%; height: 3px;
    background: var(--tool-c);
    border-radius: 0 0 3px 3px;
    transition: left 0.35s ease, right 0.35s ease;
}

.pdfc-tool:hover::before { left: 0; right: 0; }

.pdfc-tool:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--tool-c) 25%, transparent);
}

.pdfc-tool-icon {
    width: 52px; height: 52px; border-radius: 50%;
    background: color-mix(in srgb, var(--tool-c) 10%, white);
    color: var(--tool-c);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin: 0 auto 14px;
    transition: transform 0.3s ease;
}

.pdfc-tool:hover .pdfc-tool-icon { transform: scale(1.1); }

.pdfc-tool h4 {
    font-family: var(--font-heading); font-size: 1.05rem;
    font-weight: 700; color: var(--color-text-dark); margin-bottom: 8px;
}

.pdfc-tool p {
    font-size: 0.82rem; color: var(--color-text-light); line-height: 1.55; margin-bottom: 14px;
}

/* Mini animations inside tool cards */
.pdfc-tool-mini {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; height: 36px;
}

.pdfc-tm-p {
    width: 28px; height: 32px; background: #fff;
    border: 1.5px solid #e2e8f0; border-radius: 4px;
}

.pdfc-tm-a { border-color: #f97316; }
.pdfc-tm-b { border-color: #639BF1; }
.pdfc-tm-plus { font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); }
.pdfc-tm-arrow { font-size: 0.7rem; color: var(--color-text-muted); }

.pdfc-tm-full { width: 32px; height: 32px; }
.pdfc-tm-split { display: flex; gap: 3px; }
.pdfc-tm-half { width: 16px; height: 32px; }

.pdfc-tm-big { width: 36px; height: 36px; }
.pdfc-tm-small { width: 24px; height: 24px; }

.pdfc-tm-rotate {
    width: 28px; height: 32px;
    animation: pdfcMiniRotate 3s ease-in-out infinite;
}

@keyframes pdfcMiniRotate {
    0%, 40% { transform: rotate(0deg); }
    50%, 80% { transform: rotate(90deg); }
    90%, 100% { transform: rotate(0deg); }
}

.pdfc-tm-label {
    font-size: 0.6rem; font-weight: 700; color: #64748b;
    padding: 4px 8px; background: #f1f5f9; border-radius: 4px;
}

.pdfc-tm-pdf { color: #ef4444; background: #fef2f2; }

.pdfc-tm-edit { position: relative; }

.pdfc-tm-pencil {
    position: absolute; top: -4px; right: -4px;
    font-size: 0.5rem; color: #d4af7a;
    animation: pdfcMiniPencil 2s ease-in-out infinite;
}

@keyframes pdfcMiniPencil {
    0%, 100% { transform: translate(0,0); }
    50% { transform: translate(-3px, 3px); }
}

/* ========================================
   Page Preview Animation
   ======================================== */
.pdfc-preview-anim {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 10px; padding: 20px; width: 100%;
}

.pdfc-pv-page {
    background: #fff; border-radius: 8px;
    padding: 12px 10px;
    border-top: 3px solid var(--pv-c);
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; gap: 6px;
    position: relative;
    transition: all 0.3s ease;
}

.pdfc-pv-line { height: 5px; background: #e8edf5; border-radius: 3px; }
.pdfc-pv-line.short { width: 55%; }

.pdfc-pv-rotate {
    animation: pdfcPvRotate 4s 1s ease-in-out infinite;
}

@keyframes pdfcPvRotate {
    0%, 30% { transform: rotate(0deg); }
    40%, 70% { transform: rotate(90deg); }
    80%, 100% { transform: rotate(0deg); }
}

.pdfc-pv-rotate-icon, .pdfc-pv-del-icon {
    position: absolute; top: 4px; right: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.45rem; color: #fff;
}

.pdfc-pv-rotate-icon { background: #a78bfa; }
.pdfc-pv-del-icon { background: #ef4444; }

.pdfc-pv-del {
    animation: pdfcPvDel 4s 2s ease-in-out infinite;
}

@keyframes pdfcPvDel {
    0%, 40% { opacity: 1; transform: scale(1); }
    50% { opacity: 0; transform: scale(0.8); }
    60%, 100% { opacity: 1; transform: scale(1); }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .pdfc-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .pdfc-preview-anim { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .pdfc-tools-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .pdfc-p1, .pdfc-p2, .pdfc-merge-arrow, .pdfc-result,
    .pdfc-tm-rotate, .pdfc-tm-pencil,
    .pdfc-pv-rotate, .pdfc-pv-del { animation: none !important; opacity: 1; transform: none; }
}
