.pdf-pn-hidden {
    display: none !important;
}

.pdf-page-number-tool {
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 20px;
}

.tool-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tool-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 1.8rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 20px;
}

.upload-box {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    max-width: 500px;
    margin: 0 auto;
}

.upload-box.highlight {
    border-color: #3498db;
    background-color: #f8fafc;
}

.file-input {
    display: none;
}

.upload-label {
    display: block;
    cursor: pointer;
    position: relative;
}

.upload-subtext {
    font-size: 16px;
    color: #535A5B;
    margin: 0;
    text-align: center;
}

.select-file-button {
    background-color: #2c78ae;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 9px 13px;
    font-size: 17px;
    cursor: pointer;
    margin-bottom: 8px;
}


/* Main Content */
.main-content {
    display: none;
}

.content-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.input-section,
.result-section {
    flex: 1;
}

/* Options Section */
.options-section {
    margin: 25px 0;
}

.toggle-options {
    display: none;
    /* Hidden by default, shown on mobile */
    width: 100%;
    padding: 0;
    background-color: transparent;
    border: none;
    margin-bottom: 10px;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-options-checkbox {
    margin: 0;
    width: 1.2em;
    height: 1.2em;
}

.toggle-options-label {
    font-weight: 500;
    color: #2c3e50;
    line-height: 1;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-row {
    display: flex;
    gap: 20px;
}

.option-group {
    flex: 1;
    margin-bottom: 0;
}

.option-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 16px;
    color: #2c3e50;
}

.option-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

/* Custom arrow for select dropdown */
select.option-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L10 12L14 8' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 20px 20px;
    padding-right: 40px;
    /* Make space for icon */
    cursor: pointer;
}

.size-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.color-group .option-label {
    margin-bottom: 12px;
}

.color-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 80px;
    height: 40px;
    padding: 0;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

.color-hex {
    width: calc(100% - 60px);
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 15px;
    text-transform: uppercase;
    box-sizing: border-box;
}

.tool-container input[type="number"],
.tool-container input[type="text"] {
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
}

/* Hides spinners (up and down arrows) in custom input boxes */
.tool-container input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.tool-container input[type="number"]::-webkit-inner-spin-button,
.tool-container input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.process-button,
.download-button,
.clear-button {
    padding: 8px 13px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s ease;
}

.process-button {
    background-color: #2c78ae;
    color: white;
}

.download-button {
    background-color: #09803c;
    color: white;
    text-decoration: none;
    text-align: center;
}

.clear-button {
    background-color: #c0392b;
    color: white;
}

.select-file-button:active,
.process-button:active,
.download-button:active,
.clear-button:active {
    transform: scale(0.96);
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Section */
.result-section {
    border-radius: 8px;
}

.preview-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.page-nav-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-nav-btn {
    background: none;
    border: 1px solid #bdc3c7;
    border-radius: 50%;
    cursor: pointer;
    color: #2c3e50;
    transition: background-color 0.2s, opacity 0.2s, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-sizing: border-box;
}

.page-nav-btn svg {
    width: 22px;
    height: 22px;
}

.page-nav-btn i {
    font-size: 14px;
}

.page-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-nav-btn:not(:disabled):active {
    transform: scale(0.9);
}

.preview-container {
    background-color: #ecf0f1;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-placeholder {
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

.fullscreen-button {
    background-color: rgba(44, 62, 80, 0.6);
    border: none;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 7px;
}

.fullscreen-button:active {
    transform: scale(0.9);
}

.fullscreen-button svg {
    width: 22px;
    height: 22px;
}

.fullscreen-button i {
    color: #ffffff;
    font-size: 18px;
}

.preview-container:hover .fullscreen-button {
    opacity: 1;
}

.preview-container canvas {
    max-width: 100%;
    height: auto;
    max-height: 400px;
}

/* Prevent WP theme styles on icon buttons */
.tool-container .page-nav-btn:hover,
.tool-container .page-nav-btn:focus,
.tool-container .page-nav-btn:active:not(:disabled) {
    background: none;
    box-shadow: none;
    outline: none;
    border-color: #bdc3c7;
    color: #2c3e50;
}

.tool-container .page-nav-btn:active:not(:disabled) {
    transform: scale(0.9);
}

.tool-container .fullscreen-button:hover,
.tool-container .fullscreen-button:focus,
.tool-container .fullscreen-button:active {
    background-color: rgba(44, 62, 80, 0.6);
    box-shadow: none;
    outline: none;
}

.tool-container .fullscreen-button:active {
    transform: scale(0.9);
    outline: none;
}

/* Prevent WP theme styles on main action buttons */
.tool-container .select-file-button:hover,
.tool-container .select-file-button:focus,
.tool-container .select-file-button:active,
.tool-container .process-button:hover,
.tool-container .process-button:focus,
.tool-container .process-button:active,
.tool-container .download-button:hover,
.tool-container .download-button:focus,
.tool-container .download-button:active,
.tool-container .clear-button:hover,
.tool-container .clear-button:focus,
.tool-container .clear-button:active {
    box-shadow: none;
    outline: none;
}

.tool-container .select-file-button:active,
.tool-container .process-button:active,
.tool-container .download-button:active,
.tool-container .clear-button:active {
    box-shadow: none;
    transform: scale(0.96);
}

.tool-container .select-file-button:hover,
.tool-container .select-file-button:focus,
.tool-container .select-file-button:active,
.tool-container .process-button:hover,
.tool-container .process-button:focus,
.tool-container .process-button:active {
    background-color: #2c78ae;
    color: white;
}

.tool-container .download-button:hover,
.tool-container .download-button:focus,
.tool-container .download-button:active {
    background-color: #09803c;
    color: white;
}

.tool-container .clear-button:hover,
.tool-container .clear-button:focus,
.tool-container .clear-button:active {
    background-color: #c0392b;
    color: white;
}

.tool-container .option-select:hover,
.tool-container .option-select:focus,
.tool-container .option-select:active,
.tool-container .size-input:hover,
.tool-container .size-input:focus,
.tool-container .size-input:active,
.tool-container .color-hex:hover,
.tool-container .color-hex:focus,
.tool-container .color-hex:active {
    background-color: #ffffff;
    border-color: #3498db;
    box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.2);
    /* Light blue glow */
    outline: none;
}

.comparison-table {
    width: 50%;
    border-collapse: collapse;
    margin: 20px 0;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #e0e0e0;
    padding: 12px;
    text-align: left;
}

.comparison-table th {
    background-color: #f8f9fa;
}

.faq-list {
    margin-top: 1rem;
}

.faq-list dt {
    font-weight: 500;
    font-size: 1.1em;
}

.faq-list dd {
    margin-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .pdf-page-number-tool {
        padding: 0;
    }

    .tool-container {
        padding: 15px 0;
        box-shadow: none;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        border-radius: 0;
    }

    .tool-title {
        font-size: 1.5rem;
    }

    .comparison-table {
        width: 100%;
    }

    .fullscreen-button {
        opacity: 1;
    }

    .toggle-options {
        display: flex;
    }

    .options-container {
        display: none;
    }

    .options-container.show {
        display: flex;
    }

    .option-row {
        flex-direction: column;
        gap: 15px;
    }

    #first-number {
        width: 80px;
    }

    .content-columns {
        flex-direction: column;
    }

    .input-section,
    .result-section {
        /* Prevents flex items from overflowing their container on mobile */
        min-width: 0;
    }
}

/* Fullscreen styles */
.preview-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container.fullscreen canvas {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-height: 95vh;
}

.preview-spinner {
    position: absolute;
    z-index: 5;
    background: none;
    border: none;
    padding: 0;
    cursor: default;
}

.preview-spinner .spinner-svg {
    animation: spin 1.5s linear infinite;
    width: 40px;
    height: 40px;
}

.preview-spinner .spinner-path {
    stroke: #3498db;
    stroke-linecap: round;
    animation: spinner-dash 1.5s ease-in-out infinite;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
}

@keyframes spinner-dash {
    0% {
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dashoffset: -124;
    }
}

.preview-container.fullscreen img {
    max-width: 100%;
    max-height: 100%;
}