/* ============================================================
   TOOLS CSS — AI Tool Pages
   ============================================================ */

/* ---- TOOL HERO ---- */
.tool-hero {
    background: #0F172A;
    /* Fallback for older browsers */
    background: var(--gradient, linear-gradient(135deg, #0F172A 0%, #1E1B4B 45%, #0F172A 100%)) !important;
    padding: 64px 24px 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.tool-hero-label {
    display: inline-block;
    background: rgba(255, 107, 0, 0.2);
    border: 1px solid rgba(255, 107, 0, 0.35);
    color: #FFB07A;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.tool-hero h1 {
    font-size: clamp(28px, 5vw, 52px);
    color: #fff;
    margin-bottom: 16px;
}

.tool-hero p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.72);
    max-width: 580px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.tool-hero-meta {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.tool-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* ---- TOOL LAYOUT ---- */
.tool-page-layout {
    max-width: 1080px;
    /* Slightly tighter for better focus */
    margin: 40px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* Ensure global container doesn't blow up on tool pages */
.tool-standard-wrap.container {
    max-width: 1100px !important;
}

.tool-main {
    min-width: 0;
}

.tool-sidebar {
    position: sticky;
    top: 88px;
}

/* ---- TOOL INTERFACE ---- */
.tool-interface {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid var(--border);
}

.tool-interface-header {
    background: #FAFAFA;
    border-bottom: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-interface-icon {
    font-size: 24px;
}

.tool-interface-header h2 {
    font-size: 18px;
    color: var(--text-dark);
}

.tool-interface-body {
    padding: 28px;
}

/* Drop Zone */
.drop-zone {
    text-align: center;
    border: 2px dashed var(--border);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone .input-label {
    font-size: 18px;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .drop-zone {
        padding: 40px 20px;
    }

    .drop-zone .input-label {
        font-size: 16px;
    }
}

.tool-input-panel {
    margin-bottom: 24px;
}


.input-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.tool-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-dark);
    background: #FAFAFA;
    transition: var(--transition);
    outline: none;
    resize: vertical;
}

.tool-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.tool-input::placeholder {
    color: #B0B7C3;
}

.tool-input-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.tool-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.tool-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FF6B00;
    /* Fallback */
    background: var(--gradient-orange, linear-gradient(135deg, #FF6B00, #FF8A30));
    color: #FFFFFF !important;
    padding: 14px 32px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.tool-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.4);
}

.tool-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.tool-model-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.model-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
}

/* ---- LOADING SPINNER ---- */
.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 28px;
    gap: 16px;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 107, 0, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-spinner p {
    color: var(--text-muted);
    font-weight: 500;
}

.loading-dots span {
    display: inline-block;
    animation: dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {

    0%,
    80%,
    100% {
        opacity: 0.2;
    }

    40% {
        opacity: 1;
    }
}

/* ---- OUTPUT PANEL ---- */
.tool-output-panel {
    display: none;
    border-top: 1px solid var(--border);
    padding: 28px;
    animation: fadeInUp 0.4s ease;
}

.tool-output-panel.visible {
    display: block;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.output-header h3 {
    font-size: 16px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.output-actions {
    display: flex;
    gap: 8px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F3F4F6;
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-copy.copied {
    background: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
}

.btn-regenerate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-regenerate:hover {
    background: var(--primary);
    color: #fff;
}

/* Output Content */
.output-content {
    background: #F9FAFB;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 24px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-dark);
    min-height: 120px;
}

.output-content.json-output {
    font-family: var(--font-mono);
    font-size: 13px;
    background: #0F172A;
    color: #E2E8F0;
    border-color: #1E293B;
}

/* Meta Generator specific */


.meta-field {
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.meta-field-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.meta-field-label .char-badge {
    font-weight: 600;
    color: var(--accent-green);
    font-family: var(--font-mono);
}

.meta-field-label .char-badge.over {
    color: #EF4444;
}

.meta-field-value {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
}

/* Keyword Cluster specific */
.cluster-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cluster-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 18px 20px;
}

.cluster-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cluster-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
}

.cluster-intent {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: capitalize;
}

.intent-informational {
    background: #DBEAFE;
    color: #1D4ED8;
}

.intent-commercial {
    background: #FEF3C7;
    color: #B45309;
}

.intent-transactional {
    background: #D1FAE5;
    color: #065F46;
}

.intent-navigational {
    background: #EDE9FE;
    color: #5B21B6;
}

.cluster-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    background: #F3F4F6;
    color: var(--text-dark);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 13px;
}

/* Blog Outline specific */
.outline-content {
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.8;
}

/* ---- TOOL ERROR ---- */
.tool-error {
    display: none;
    padding: 16px 20px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    color: #991B1B;
    font-size: 14px;
    margin-top: 16px;
    align-items: center;
    gap: 10px;
}

.tool-error.visible {
    display: flex;
}

/* ---- TOOL DESCRIPTION (SEO Content) ---- */
.tool-description-section {
    margin-top: 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.tool-description-section h2 {
    font-size: 26px;
    margin-bottom: 16px;
}

.tool-description-section h3 {
    font-size: 20px;
    margin: 28px 0 12px;
}

.tool-description-section p {
    color: #4B5563;
    line-height: 1.8;
    margin-bottom: 16px;
}

.tool-description-section ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.tool-description-section ul li {
    color: #4B5563;
    line-height: 1.7;
    margin-bottom: 8px;
    list-style: disc;
}

/* ---- TOOLS LISTING PAGE ---- */
.tools-listing-hero {
    background: var(--gradient);
    padding: 72px 24px;
    text-align: center;
}

.tools-listing-hero h1 {
    font-size: clamp(30px, 5vw, 52px);
    color: #fff;
    margin-bottom: 16px;
}

.tools-listing-hero p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 18px;
    max-width: 560px;
    margin: 0 auto;
}

.tools-listing-grid {
    max-width: 1200px;
    margin: 56px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.tools-listing-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 36px;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    display: block;
}

.tools-listing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 107, 0, 0.2);
}

.tools-listing-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.tools-listing-card h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.tools-listing-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.tools-listing-card .cta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .tool-page-layout {
        grid-template-columns: 100%;
        gap: 24px;
    }

    .tool-sidebar {
        position: static;
        order: 2;
        width: 100%;
        max-width: 100%;
    }

    .tool-main {
        order: 1;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .tool-hero {
        padding: 40px 16px 32px;
    }

    .tool-hero h1 {
        font-size: 28px;
    }

    .tool-interface-header {
        padding: 16px 20px;
    }

    .tool-interface-body {
        padding: 16px;
    }

    .tool-submit-row {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .tool-submit-btn {
        justify-content: center;
        width: 100%;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .output-actions {
        width: 100%;
    }

    .output-actions .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .tool-description-section {
        padding: 24px;
    }

    .tools-listing-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   NEW TOOL OUTPUT COMPONENTS (AI-Tools.js Rendering)
   ============================================================ */

/* ---- SEO METRICS GRID (DA/PA/Traffic) ---- */
.seo-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background: #fff;
    padding: 24px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.metric-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    font-family: var(--font-heading);
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seo-url-info {
    font-size: 14px;
    color: var(--text-muted);
    padding: 12px 16px;
    background: var(--bg-soft);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

/* ---- KEYWORD CLUSTER GRID ---- */
.cluster-strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.cluster-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.cluster-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.cluster-card-head {
    padding: 20px;
    background: #FAFAFA;
    border-bottom: 1px solid var(--border);
}

.cluster-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cluster-card-head h4 {
    font-size: 18px;
    color: var(--text-dark);
}

.cluster-strategy {
    padding: 20px;
    font-size: 14px;
    color: var(--text-body);
    flex-grow: 1;
}

.cluster-keywords-list {
    padding: 16px 20px;
    background: #F9FAFB;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px dashed var(--border);
}

.k-tag {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-body);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.k-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- GOOGLE SEARCH PREVIEW ---- */
.meta-preview-wrap {
    margin-bottom: 32px;
}

.preview-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.google-preview-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    max-width: 600px;
    box-shadow: var(--shadow-sm);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-site-icon {
    width: 28px;
    height: 28px;
    background: #e8eaed;
    color: #5f6368;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.preview-site-info {
    display: flex;
    flex-direction: column;
}

.site-name {
    font-size: 14px;
    color: #202124;
}

.site-url {
    font-size: 12px;
    color: #5f6368;
}

.preview-title {
    color: #1a0dab;
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1.3;
    cursor: pointer;
}

.preview-title:hover {
    text-decoration: underline;
}

.preview-description {
    font-size: 14px;
    color: #4d5156;
    line-height: 1.58;
}

.meta-data-card {
    margin-top: 24px;
    display: grid;
    gap: 20px;
}

.meta-data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.meta-data-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.meta-data-item label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.data-value-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background: #F9FAFB;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.data-value-row span {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 500;
    word-break: break-word;
}

.char-count-meta {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-green);
    text-align: right;
}

.char-count-meta.warning {
    color: #EF4444;
}

.strategy-insight {
    padding: 20px;
    background: #FFF7F0;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

/* ---- PREMIUM CODE BLOCK ---- */
.premium-code-block {
    background: #0F172A;
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    border: 1px solid #1e293b;
    color: #E2E8F0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Responsive Overrides for Output Components */
@media (max-width: 992px) {
    .seo-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .cluster-strategy-grid {
        grid-template-columns: 1fr;
    }

    .google-preview-card {
        padding: 16px;
    }

    .preview-title {
        font-size: 18px;
    }
}

/* ---- HEADER POLISH ---- */
@media (min-width: 769px) {

    .mobile-auth-links,
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 768px) {

    .header-auth,
    .desktop-only {
        display: none !important;
    }

    .mobile-auth-links {
        display: flex !important;
        flex-direction: column;
        padding: 20px;
        border-top: 1px solid var(--border);
    }

}

/* ---- TRAFFIC DASHBOARD CSS ---- */
.traffic-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.traffic-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.traffic-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.stat-icon {
    font-size: 24px;
    background: #F9FAFB;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.traffic-details-row {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 20px;
    margin-top: 24px;
}

.traffic-keywords-panel,
.traffic-share-panel {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.traffic-keywords-panel h5,
.traffic-share-panel h5 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.traffic-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.t-key-tag {
    background: #F3F4F6;
    color: var(--text-dark);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.t-key-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.share-badge {
    background: #E5FAEE;
    color: #059669;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 600px) {
    .traffic-details-row {
        grid-template-columns: 1fr;
    }
}

/* ---- PDF EDITOR UPGRADE CSS ---- */
.pdf-workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 24px;
    background: #F9FAFB;
    border-radius: 12px;
    border: 2px dashed var(--border);
    min-height: 200px;
    margin-bottom: 30px;
}

.pdf-page-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.pdf-page-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.page-thumb {
    position: relative;
    aspect-ratio: 1 / 1.4;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.page-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.page-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.page-meta {
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.file-source {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-actions {
    display: flex;
    padding: 8px;
    gap: 5px;
    background: #fdfdfd;
}

.action-btn {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.action-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
}

.action-btn.delete:hover {
    background: #FEF2F2;
    border-color: #EF4444;
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.workspace-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.workspace-info {
    font-weight: 700;
    color: var(--text-dark);
}

.drop-zone.dragover {
    border-color: var(--primary) !important;
    background: var(--primary-light) !important;
}

.drop-zone-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* ---- ADVANCED PDF EDITOR STYLES ---- */
.pdf-workspace-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    /* Larger thumbnails */
}

.page-actions-group {
    padding: 12px;
    background: #fcfcfc;
    border-top: 1px solid #eee;
}

.action-row {
    display: flex;
    gap: 8px;
}

.action-row .action-btn {
    flex: 1;
    font-size: 16px;
    padding: 8px;
}

.anno-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #FFD700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-dark);
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.feature-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.feature-item h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
    }
}