/* Custom Styles for Extract PDF Tool */

.btn-primary {
    border: none;
    background: linear-gradient(135deg, #FF5A3C, #FF8A3D);
    color: #ffffff !important;
    border-radius: 10px;
    padding: 13px 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(255, 90, 60, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(255, 90, 60, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #cbd5e1;
    color: #94a3b8 !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

.main-layout {
    display: grid;
    grid-template-columns: 1.75fr 0.82fr;
    gap: 30px;
    align-items: start;
    width: 100%;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.dropzone {
    border: 2px dashed #a78bfa;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #faf7ff);
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 18px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.drop-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FF5A3C, #FF8A3D);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 15px;
}

.dropzone h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 750;
    color: #0f172a;
}

.dropzone .or {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

.dropzone p {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.pdf-icon {
    width: 44px;
    height: 52px;
    border-radius: 8px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.pdf-icon::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    border-top: 12px solid #fecaca;
    border-left: 12px solid transparent;
    border-radius: 0 8px 0 0;
}

.remove-btn {
    border: none;
    background: transparent;
    font-size: 26px;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s;
}

.remove-btn:hover {
    color: #ef4444;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-value {
    font-weight: 900;
    font-size: 17px;
    color: #0f172a;
}

.extract-card {
    padding: 24px;
}

.extract-card h3 {
    font-size: 18px;
    margin-bottom: 18px;
    font-weight: 850;
    color: #0f172a;
}

.extract-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.extract-type {
    min-height: 122px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 16px;
    align-items: center;
    position: relative;
    cursor: pointer;
    background: #ffffff;
    transition: 0.2s;
}

.extract-type:hover {
    border-color: #c4b5fd;
    box-shadow: 0 10px 24px rgba(255, 90, 60, 0.08);
    transform: translateY(-2px);
}

.extract-type.active {
    border-color: #FF8A3D;
    box-shadow: 0 10px 28px rgba(255, 138, 61, 0.1);
}

.type-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.pages-icon {
    background: #ede9fe;
    color: #6d28d9;
}

.images-icon {
    background: #dcfce7;
    color: #16a34a;
}

.text-icon {
    background: #fff7ed;
    color: #f97316;
}

.type-title {
    font-weight: 900;
    font-size: 17px;
    margin-bottom: 7px;
    color: #0f172a;
}

.type-desc {
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

.radio-dot {
    position: absolute;
    left: 20px;
    bottom: 18px;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
}

.extract-type.active .radio-dot {
    border-color: #FF5A3C;
}

.extract-type.active .radio-dot::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #FF5A3C;
}

.pages-range {
    border-top: 1px solid #e5e7eb;
    padding-top: 22px;
}

.range-title {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 16px;
    color: #0f172a;
}

.range-row {
    display: grid;
    grid-template-columns: 120px 160px 1fr 180px;
    gap: 20px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    color: #334155;
    font-size: 14px;
    cursor: pointer;
}

.radio-label input {
    width: 18px;
    height: 18px;
    accent-color: #FF5A3C;
}

.range-input {
    width: 100%;
    height: 46px;
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    font-weight: 700;
}

.range-input:focus {
    border-color: #FF5A3C;
}

.example {
    color: #64748b;
    font-size: 14px;
}

/* Settings Sidebar */
.settings-card {
    padding: 28px;
}

.settings-card h2 {
    font-size: 22px;
    margin-bottom: 26px;
    font-weight: 850;
    color: #0f172a;
}

.form-group {
    margin-bottom: 26px;
}

.form-group label,
.section-label {
    display: block;
    color: #0f172a;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 800;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}

.format-card {
    min-height: 110px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    cursor: pointer;
    gap: 9px;
    text-align: center;
    font-weight: 900;
    transition: 0.2s;
    user-select: none;
}

.format-card:hover {
    border-color: #c4b5fd;
    transform: translateY(-1px);
}

.format-card.active {
    border-color: #FF8A3D;
    background: #faf5ff;
    color: #FF5A3C;
    box-shadow: 0 8px 20px rgba(255, 138, 61, 0.08);
}

.format-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #e5e7eb;
    background: #f1f5f9;
    color: #94a3b8;
}

.format-card.disabled:hover {
    transform: none;
    border-color: #e5e7eb;
}

.format-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
}

.format-sub {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.format-card.disabled .format-sub {
    color: #94a3b8;
}

.pdf-format {
    background: #FF5A3C;
}

.jpg-format {
    background: #16a34a;
}

.png-format {
    background: #f97316;
}

.txt-format {
    background: #2563eb;
}

.csv-format {
    background: #22c55e;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 24px;
}

.option {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
    cursor: pointer;
}

.option input {
    width: 20px;
    height: 20px;
    accent-color: #FF5A3C;
    margin-top: 2px;
}

.option-title {
    font-weight: 800;
    color: #334155;
    margin-bottom: 4px;
}

.option-desc {
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 24px;
    color: #475569;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: #FF5A3C;
}

.extract-btn {
    width: 100%;
    height: 58px;
    font-size: 17px;
    border-radius: 12px;
}

.safe-note {
    margin-top: 17px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.safe-note strong {
    color: #16a34a;
}

/* Document Previews */
.page-thumb {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    min-height: 128px;
    position: relative;
    transition: 0.2s;
}

.page-thumb:hover {
    border-color: #c4b5fd;
    box-shadow: 0 10px 24px rgba(255, 90, 60, 0.08);
}

.page-box {
    height: 78px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 8px;
    overflow: hidden;
    position: relative;
}

.page-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 10px;
}

.page-check {
    width: 17px;
    height: 17px;
    accent-color: #FF5A3C;
    cursor: pointer;
}

.page-number {
    font-size: 14px;
    color: #334155;
    font-weight: 700;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 9px;
    cursor: pointer;
    color: #334155;
    font-weight: 700;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: #c4b5fd;
    background: #faf7ff;
}

.page-btn.active {
    background: #FF5A3C;
    color: #ffffff;
    border-color: #FF5A3C;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 18px;
    overflow: hidden;
}

.feature {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 28px 34px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.feature:first-child {
    border-radius: 18px 0 0 18px;
}

.feature:last-child {
    border-radius: 0 18px 18px 0;
}

.feature-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.green {
    background: #dcfce7;
    color: #16a34a;
}

.purple {
    background: #f3e8ff;
    color: #FF8A3D;
}

.blue {
    background: #dbeafe;
    color: #2563eb;
}

.feature h3 {
    font-size: 18px;
    margin-bottom: 7px;
    font-weight: 750;
    color: #0f172a;
}

.feature p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .range-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feature,
    .feature:first-child,
    .feature:last-child {
        border-radius: 18px;
    }

    .file-info {
        grid-template-columns: 1fr;
    }

    .extract-type-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 24px 16px 40px;
    }

    .page-title h1 {
        font-size: 30px;
    }

    .format-grid {
        grid-template-columns: 1fr;
    }

    .range-row {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}
