/* add-page-number.css - Clean & Modern Design for Add Page Number Tool */

/* ===== STEP 2 LAYOUT ===== */
.cover-settings-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    border: var(--benefit-card-border);
}

@media (min-width: 992px) {
    .cover-settings-container {
        grid-template-columns: 1fr 350px;
    }
}

/* ===== SETTINGS PANEL ===== */
.cover-settings-panel {
    border-radius: 10px;
    padding: 25px;
    border-top: none;
}

/* ===== COLLAPSIBLE STEPPER ===== */
.stepper-container {
    margin-bottom: 20px;
}

.stepper-step {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--dark-menu-bg);
    border: var(--benefit-card-border);
}

.stepper-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    gap: 20px;
}

.stepper-header:hover {
    background-color: var(--primary-dark);
    color: white;
}

.stepper-header:hover .stepper-title {
    color: white;
}

.stepper-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-text);
    font-weight: 600;
    font-size: 1.1em;
}

.stepper-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-dark);
    border-radius: 50%;
    color: white;
    font-size: 0.8em;
}

.stepper-toggle {
    color: var(--dark-text);
    transition: var(--transition);
}

.stepper-step.active .stepper-toggle {
    transform: rotate(180deg);
}

.stepper-content {
    padding: 20px;
    display: none;
}

.stepper-step.active .stepper-content {
    display: block;
}

.stepper-step.active .stepper-header {
    background-color: var(--primary-medium);
}

.stepper-step.active .stepper-title {
    color: white;
}

.stepper-step.active .stepper-icon {
    background-color: var(--primary-light);
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 0.95em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: var(--benefit-card-border);
    background-color: var(--background-dark);
    color: var(--dark-text);
    font-size: 1em;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-medium);
    box-shadow: 0 0 0 3px rgba(106, 156, 137, 0.3);
    outline: none;
}

.form-control[type="color"] {
    width: 60px;
    height: 40px;
    padding: 3px;
    background: var(--dark-bg);
    border: 1px solid var(--dropdown-divider);
    border-radius: 4px;
}

/* ===== POSITION GRID ===== */
.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.position-item {
    cursor: pointer;
    display: block;
}

.position-item input[type="radio"] {
    display: none;
}

.position-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    border: 2px solid var(--dropdown-divider);
    border-radius: 8px;
    transition: var(--transition);
    background: var(--dark-bg);
}

.position-item input[type="radio"]:checked+.position-visual {
    border-color: var(--primary-medium);
    background: rgba(106, 156, 137, 0.1);
    box-shadow: 0 2px 8px rgba(106, 156, 137, 0.2);
}

.position-item:hover .position-visual {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.position-dot {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-medium);
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    background: var(--dark-menu-bg);
}

.position-dot::after {
    content: "1";
    position: absolute;
    font-size: 12px;
    color: var(--primary-medium);
    font-weight: bold;
}

/* Position dot positions */
.top-left-dot::after {
    top: 6px;
    left: 6px;
}

.top-center-dot::after {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.top-right-dot::after {
    top: 6px;
    right: 6px;
}

.bottom-left-dot::after {
    bottom: 6px;
    left: 6px;
}

.bottom-center-dot::after {
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.bottom-right-dot::after {
    bottom: 6px;
    right: 6px;
}

.position-visual span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-text);
    text-align: center;
}

/* ===== FORMAT SELECTOR ===== */
.format-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-item {
    cursor: pointer;
    display: block;
}

.format-item input[type="radio"] {
    display: none;
}

.format-content {
    padding: 16px;
    border: 2px solid var(--dropdown-divider);
    border-radius: 8px;
    transition: var(--transition);
    background: var(--dark-bg);
}

.format-item input[type="radio"]:checked+.format-content {
    border-color: var(--primary-medium);
    background: rgba(106, 156, 137, 0.1);
    box-shadow: 0 2px 8px rgba(106, 156, 137, 0.2);
}

.format-item:hover .format-content {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.format-name {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 4px;
}

.format-example {
    font-size: 0.85rem;
    color: var(--primary-light);
    opacity: 0.8;
}

/* ===== PAGES SELECTOR ===== */
.pages-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pages-item {
    cursor: pointer;
    display: block;
}

.pages-item input[type="radio"] {
    display: none;
}

.pages-content {
    padding: 16px;
    border: 2px solid var(--dropdown-divider);
    border-radius: 8px;
    transition: var(--transition);
    background: var(--dark-bg);
}

.pages-item input[type="radio"]:checked+.pages-content {
    border-color: var(--primary-medium);
    background: rgba(106, 156, 137, 0.1);
    box-shadow: 0 2px 8px rgba(106, 156, 137, 0.2);
}

.pages-item:hover .pages-content {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.pages-name {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 4px;
}

.pages-desc {
    font-size: 0.85rem;
    color: var(--primary-light);
    opacity: 0.8;
}

.pages-input-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--dark-menu-bg);
    border-radius: 8px;
    border: 1px solid var(--dropdown-divider);
}

.input-help {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.help-item {
    font-size: 0.8rem;
    color: var(--primary-light);
    opacity: 0.7;
}

.help-item code {
    background: var(--dark-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
}

/* ===== PREVIEW PANEL ===== */
.preview-panel {
    border-radius: 10px;
    padding: 25px;
    border-top: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.preview-container {
    aspect-ratio: 1/1.414;
    /* Standard paper ratio */
    background: white;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.preview-text {
    text-align: center;
    margin-bottom: 20px;
}

.preview-text h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.preview-text p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.page-number-preview {
    position: absolute;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(106, 156, 137, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(106, 156, 137, 0.2);
}

/* Position classes for preview */
.page-number-preview.top-left {
    top: 15px;
    left: 15px;
}

.page-number-preview.top-center {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.page-number-preview.top-right {
    top: 15px;
    right: 15px;
    transform: none;
}

.page-number-preview.bottom-left {
    bottom: 15px;
    left: 15px;
}

.page-number-preview.bottom-center {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.page-number-preview.bottom-right {
    bottom: 15px;
    right: 15px;
    transform: none;
}

.preview-info {
    text-align: center;
    color: var(--primary-light);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== PREVIEW SUBTEXT ===== */
.preview-subtext {
    font-size: 0.85rem !important;
    color: #888 !important;
    font-style: italic;
}

/* ===== FINAL OUTPUT SUMMARY ===== */
.final-output-summary {
    background: rgba(106, 156, 137, 0.1);
    border: 2px solid var(--primary-medium);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.final-output-summary h5 {
    margin: 0 0 12px 0;
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-list li {
    color: var(--dark-text);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-list strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.summary-list span {
    color: var(--dark-text);
    font-weight: 500;
}

/* ===== NEXT STEP VALIDATION ===== */
.next-step-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.validation-helper {
    margin: 0;
    font-size: 0.85rem;
    color: var(--primary-light);
    opacity: 0.8;
    font-style: italic;
}

/* ===== VISUAL HIERARCHY TUNING ===== */
/* Strengthen Position & Format (steps 1-2) */
.stepper-step:nth-child(1),
.stepper-step:nth-child(2) {
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(106, 156, 137, 0.15);
}

.stepper-step:nth-child(1) .stepper-header,
.stepper-step:nth-child(2) .stepper-header {
    padding: 18px 20px;
}

.stepper-step:nth-child(1) .stepper-title,
.stepper-step:nth-child(2) .stepper-title {
    font-size: 1.15em;
    font-weight: 700;
}

/* Reduce Typography & Pages visual weight (steps 3-4) */
.stepper-step:nth-child(3),
.stepper-step:nth-child(4) {
    opacity: 0.9;
}

.stepper-step:nth-child(3) .stepper-header,
.stepper-step:nth-child(4) .stepper-header {
    padding: 12px 20px;
}

.stepper-step:nth-child(3) .stepper-title,
.stepper-step:nth-child(4) .stepper-title {
    font-size: 1em;
    font-weight: 500;
}

/* Enhance preview + summary confirmation zone */
.preview-panel {
    border: 2px solid var(--primary-medium);
    background: rgba(106, 156, 137, 0.05);
    box-shadow: 0 4px 16px rgba(106, 156, 137, 0.2);
}


/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
    .cover-settings-container {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .stepper-header {
        padding: 12px 15px;
    }

    .stepper-content {
        padding: 15px;
    }

    .position-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-container {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .position-grid {
        grid-template-columns: 1fr;
    }

    .format-selector,
    .pages-selector {
        flex-direction: column;
    }

    .format-content,
    .pages-content {
        text-align: center;
    }
}



/* Light Mode Adjustments */
.light-mode .stepper-step {
    background-color: var(--light-bg);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .position-visual,
.light-mode .format-content,
.light-mode .pages-content {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.light-mode .preview-text h4 {
    color: #495057;
}

.light-mode .preview-text p,
.light-mode .preview-subtext {
    color: #6c757d !important;
}

.light-mode .page-number-preview {
    color: #495057;
    background: rgba(106, 156, 137, 0.1);
    border-color: rgba(106, 156, 137, 0.3);
}

.light-mode .form-control {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--light-text);
}

.light-mode .final-output-summary {
    background: rgba(106, 156, 137, 0.08);
    border-color: var(--primary-medium);
}

.light-mode .final-output-summary h5 {
    color: var(--primary-dark);
}

.light-mode .summary-list li,
.light-mode .summary-list strong,
.light-mode .summary-list span {
    color: #495057;
}

.light-mode .validation-helper {
    color: var(--primary-dark);
}

.light-mode .preview-panel {
    background: rgba(106, 156, 137, 0.03);
    border-color: var(--primary-medium);
}

/* Animation Enhancements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stepper-step {
    animation: fadeInUp 0.3s ease-out;
}

.stepper-step:nth-child(1) {
    animation-delay: 0.1s;
}

.stepper-step:nth-child(2) {
    animation-delay: 0.2s;
}

.stepper-step:nth-child(3) {
    animation-delay: 0.3s;
}

.stepper-step:nth-child(4) {
    animation-delay: 0.4s;
}

/* Focus States for Accessibility */
.position-item:focus-within .position-visual,
.format-item:focus-within .format-content,
.pages-item:focus-within .pages-content {
    outline: 2px solid var(--primary-medium);
    outline-offset: 2px;
}

.form-control:focus {
    outline: 2px solid var(--primary-medium);
    outline-offset: 2px;
}

/* ===== STEP 3: DOWNLOAD ===== */


.file-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-icon {
    font-size: 2.5rem;
    color: #dc3545;
}

.file-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}


.processing-info {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.85rem;
    color: var(--primary-light);
    opacity: 0.7;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.download-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary-medium);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(106, 156, 137, 0.3);
    min-width: 200px;
    justify-content: center;
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 156, 137, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

.new-file-btn {
    background: transparent;
    border: 2px solid var(--primary-light);
    color: var(--primary-light);
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

.new-file-btn:hover {
    background: var(--primary-light);
    color: var(--dark-bg);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .config-columns {
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .config-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .preview-card {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .position-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .advanced-options-grid {
        grid-template-columns: 1fr;
    }

    .step-actions {
        flex-direction: column;
        align-items: center;
    }

    .step-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .preview-card {
        max-width: 280px;
    }

    .processing-info {
        flex-direction: column;
        gap: 10px;
    }

    .download-actions {
        flex-direction: column;
        gap: 15px;
    }

    .download-btn,
    .new-file-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .option-card,
    .preview-card {
        padding: 16px;
    }

    .preview-card {
        max-width: 250px;
    }

    .position-grid {
        grid-template-columns: 1fr;
    }

    .format-selector,
    .pages-selector {
        flex-direction: column;
    }

    .format-content,
    .pages-content {
        text-align: center;
    }

    .download-container {
        padding: 20px;
    }

    .file-preview {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Light Mode Adjustments */
.light-mode .option-card,
.light-mode .preview-card {
    /* background: var(--light-bg);*/
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .preview-page {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.light-mode .preview-text h4 {
    color: #495057;
}

.light-mode .preview-text p {
    color: #6c757d;
}

.light-mode .page-number-preview {
    color: #495057;
    background: rgba(106, 156, 137, 0.1);
    border-color: rgba(106, 156, 137, 0.3);
}

.light-mode .advanced-input,
.light-mode .input-group input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--light-text);
}

.light-mode .position-visual,
.light-mode .format-content,
.light-mode .pages-content {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Animation Enhancements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-card {
    animation: fadeInUp 0.3s ease-out;
}

.option-card:nth-child(1) {
    animation-delay: 0.1s;
}

.option-card:nth-child(2) {
    animation-delay: 0.2s;
}

.option-card:nth-child(3) {
    animation-delay: 0.3s;
}

.option-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Focus States for Accessibility */
.position-item:focus-within .position-visual,
.format-item:focus-within .format-content,
.pages-item:focus-within .pages-content {
    outline: 2px solid var(--primary-medium);
    outline-offset: 2px;
}

.advanced-input:focus,
.input-group input:focus {
    outline: 2px solid var(--primary-medium);
    outline-offset: 2px;
}