/* ==================================== */
/* === GLOBAL & LAYOUT STYLES === */
/* ==================================== */

body {
    font-family: Arial, sans-serif;
    margin: 40px;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

h1 { 
    margin-bottom: -20px; 
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    text-align: center;
    flex-wrap: wrap;
    gap: 20px;
}
.logo {
    max-width: 400px;
    height: auto;
}

.tagline {
    font-family: "Michroma", sans-serif;
    font-weight: 200;
    font-style: normal;
    font-size: 0.9em;
    text-align: right;
    margin: 0;
}

/* Tab styling */
.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: -1px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    margin: 0 5px;
    font-weight: bold;
    color: #495057;
    transition: all 0.3s;
    text-decoration: none;
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.tab.active {
    background-color: white;
    color: #007bff;
}

.tab:hover:not(.active) {
    background-color: #f8f9fa;
}

/* Tool container */
.tool-container {
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.tool {
    padding: 25px;
}

/* ==================================== */
/* === FILEPOND STYLING === */
/* ==================================== */

.filepond--root {
    width: 100%;
    min-height: 400px;
    margin: 20px auto;
}
.filepond--list-scroller {
    height: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}
.filepond--item {
    width: 320px;
    height: 400px;
    margin: 0 7.5px 15px 7.5px;
}
.filepond--label-action {
    cursor: pointer;
}
.filepond--credits {
    display: none;
}

/* ==================================== */
/* === BUTTONS & INPUTS STYLES === */
/* ==================================== */

.bottom-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

/* Specific button containers for flex layout - ALL IN ONE STYLESHEET */
#split-buttons,
#combine-buttons,
#compress-buttons,
#convert-buttons { 
    display: flex; 
    flex-direction: row; 
    gap: 10px; 
    width: 100%; 
    justify-content: center; 
    flex-wrap: wrap; 
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #007bff;
    color: white;
    font-size: 16px;
    transition: background 0.3s;
    width: 230px; 
    margin-right: 0;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.clear-button {
    background: #dc3545;
}
.clear-button:hover {
    background: #c82333;
}

/* ==================================== */
/* === TEXT & INSTRUCTIONS === */
/* ==================================== */

.intro-text {
    font-size: 1.25em;
    color: #4a4a4a;
    max-width: 800px;
    margin: 0 auto 20px;
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    font-weight: bold;
}

.instructions-list {
    list-style-type: none; /* Remove default numbering */
    counter-reset: custom-counter; /* Initialize the counter */
    padding: 0;
    max-width: 800px;
    margin: 0 auto 20px;
    text-align: left;
}
.instructions-list li {
    counter-increment: custom-counter; /* Increment the counter for each item */
    position: relative; /* Establish positioning context for ::before */
    
    /* Increased left padding to 50px to provide more space after the number */
    padding: 10px 10px 10px 50px; 

    /* Keep existing styles: */
    background: #f1f1f1;
    margin-bottom: 8px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-weight: 500;
}

.instructions-list li::before {
    content: counter(custom-counter); /* Display the counter value */
    position: absolute;
    left: 15px; /* Moved from 10px to 15px to shift the number slightly right */
    top: 50%;
    transform: translateY(-50%); /* Vertical centering */
    
    /* Styling the blue circle */
    background: #007bff;
    color: white;
    font-weight: bold;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.8em; 
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==================================== */
/* === FOOTER STYLES === */
/* ==================================== */

footer {
    padding: 20px;
    text-align: center;
    color: #777;
    margin-top: 40px;
    border-top: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
footer p {
    margin: 5px 0;
}
footer a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}
footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ==================================== */
/* === STATUS & LOADING STYLES === */
/* ==================================== */

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#loading-container {
    display: none; /* Hidden by default */
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}
.progress-bar {
    width: 0;
    height: 25px;
    background-color: #007bff;
    text-align: center;
    line-height: 25px;
    color: white;
    transition: width 0.3s;
}
.progress-text {
    margin-top: 5px;
    font-size: 0.9em;
    color: #495057;
}

/* ==================================== */
/* === TOOL-SPECIFIC STYLES === */
/* ==================================== */

/* Split Tool */
#splitModal div[style*="background: white"] {
    max-width: 1200px;
}

#pagePreviews {
    max-height: 600px;
    overflow-y: auto;
}

#pagePreviews > div:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}

/* Compress Tool */
#compression-selector {
    margin: 20px auto;
    width: 90%;
    max-width: 400px;
    text-align: left;
}
#compression-selector label {
    display: block;
    margin: 10px 0;
    font-weight: bold;
}
#compression-selector input[type="radio"] {
    margin-right: 10px;
}
#compression-selector p {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 20px;
}

#result-container {
    display: none;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #c3e6cb;
    background-color: #d4edda;
    border-radius: 5px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
#result-container h3 {
    color: #155724;
    margin-top: 0;
}
#file-details {
    display: none;
    text-align: left;
    margin-top: 15px;
    border-top: 1px solid #c3e6cb;
    padding-top: 15px;
    font-size: 0.9em;
}

/* Images to PDF Tool */
#conversion-options {
    margin: 20px auto;
    width: 90%;
    max-width: 400px;
    text-align: left;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}
#conversion-options label {
    display: block;
    margin: 10px 0;
    font-weight: bold;
}
#conversion-options input[type="radio"] {
    margin-right: 10px;
}
#conversion-options input[type="checkbox"] {
    margin-right: 10px;
}
#conversion-options p {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 20px;
}

/* PDF to Image Tool */
#output-images-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 10px;
    max-width: 100%;
    overflow-x: auto;
}

.output-image {
    max-width: 250px;
    height: auto;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;
}