/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Page */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #333;
}

/* ===========================
   Navigation Bar
=========================== */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    color: #2d5be3;
    transition: 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: 0.3s;
}

nav a:hover {
    color: #2d5be3;
}

.nav-buttons {
    display: flex;
    gap: 15px;
}

.login-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: .3s;
    background: transparent;
    color: #2d5be3;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .15);
}

.signup-btn {
    background: #4f46e5;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: .3s;
}

.signup-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, .18);
}

/* ===========================
   Hero Section
=========================== */

.hero {
    text-align: center;
    padding: 80px 20px;
    background: #f5f8ff;
}

.hero h1 {
    font-size: 48px;
    color: #222;
    margin-bottom: 20px;
}

.hero h2 {
    font-size: 32px;
}

.hero p {
    font-size: 20px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hero-button {
    background: #2d5be3;
    color: white;
    padding: 18px 40px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
}

.hero-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
    background: #1f48c7;
}

.hero-rating {
    margin-top: 30px;
    font-size: 18px;
    color: #555;
}

/* ===========================
   Upload Card
=========================== */

.upload-card {
    max-width: 700px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .1);
    text-align: center;
    transition: 0.3s;
}

.upload-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, .18);
}

.upload-icon {
    font-size: 70px;
}

.upload-title {
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
}

.upload-text {
    margin: 20px 0;
    color: #777;
}

.upload-or {
    color: #888;
    margin: 15px 0;
}

.file-types {
    margin-top: 20px;
    color: #777;
}

#file-name {
    margin-top: 20px;
    color: #444;
    font-weight: bold;
}

/* Drop Area */

#drop-area {
    border: 3px dashed #2d5be3;
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: .3s;
}

#drop-area:hover {
    background: #f5f8ff;
    border-color: #4f46e5;
}

#drop-area.dragover {
    background: #dbeafe;
}

/* File Input */

input[type=file] {
    width: 100%;
    margin-top: 20px;
}

#choose-btn {
    background: #2d5be3;
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

#choose-btn:hover {
    background: #1f48c7;
}

/* Buttons (general) */

button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: .3s;
}

button:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, .15);
}

#remove-image {
    margin-top: 15px;
    background: #dc2626;
}

#remove-image:hover {
    background: #b91c1c;
}

/* Preview Box */

#preview-box {
    display: none;
    margin-top: 25px;
}

#preview-image {
    width: 250px;
    border-radius: 10px;
    margin-top: 20px;
    cursor: pointer;
    transition: 0.3s;
}

#preview-image:hover {
    transform: scale(1.05);
}

#image-size,
#image-dimension {
    color: #555;
    margin-top: 5px;
}

/* Progress Bar */

#progress-container {
    width: 100%;
    height: 18px;
    background: #ddd;
    border-radius: 20px;
    margin-top: 20px;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: #2196f3;
    transition: .3s;
}

#progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
}

/* ==========================
   Features Section
========================== */

.features {
    padding: 80px 20px;
    background: #ffffff;
    text-align: center;
}

.features h2 {
    font-size: 40px;
    margin-bottom: 50px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: auto;
}

.feature-card {
    background: #f8f9ff;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
    transition: 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

.feature-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

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

.footer {
    background: #1d1d1d;
    color: white;
    margin-top: 80px;
    padding: 60px 10% 30px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-column {
    flex: 1;
    min-width: 220px;
}

.footer-column h3 {
    margin-bottom: 20px;
}

.footer-column p {
    color: #cccccc;
    line-height: 1.7;
}

.footer-column a {
    display: block;
    color: #cccccc;
    text-decoration: none;
    margin: 10px 0;
    transition: .3s;
}

.footer-column a:hover {
    color: white;
}

.footer hr {
    margin: 40px 0 20px;
    border: none;
    border-top: 1px solid #444;
}

.copyright {
    text-align: center;
    color: #aaaaaa;
}

/* ===================================
   RESPONSIVE DESIGN
=================================== */

@media (max-width: 1024px) {
    .hero h1 {
        font-size: 48px;
    }

    .navbar {
        padding: 20px 5%;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .nav-buttons {
        justify-content: center;
    }

    .hero {
        padding: 80px 20px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero p {
        font-size: 22px;
    }

    .upload-card {
        width: 95%;
        padding: 30px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 18px;
    }

    .hero-button {
        width: 100%;
    }

    #preview-image {
        width: 100%;
        height: auto;
    }

    #preview-image:hover {
        transform: scale(1.03);
    }

    .upload-card {
        padding: 20px;
    }

    button {
        width: 100%;
    }
}
/* ===========================
   ALL TOOLS
=========================== */

.tools {

    padding: 80px 20px;

    background: white;

    text-align: center;

}

.tools h2 {

    font-size: 42px;

    margin-bottom: 15px;

}

.tools-subtitle {

    color: #666;

    margin-bottom: 50px;

    font-size: 18px;

}

.tools-grid {

    max-width: 1200px;

    margin: auto;

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(250px,1fr));

    gap: 30px;

}

.tool-card {

    background: #f8f9ff;

    padding: 35px;

    border-radius: 16px;

    transition: .3s;

    cursor: pointer;

    box-shadow: 0 10px 25px rgba(0,0,0,.08);

}

.tool-card:hover {

    transform: translateY(-8px);

    box-shadow: 0 20px 40px rgba(0,0,0,.15);

}

.tool-icon {

    font-size: 60px;

    margin-bottom: 20px;

}

.tool-card h3 {

    margin-bottom: 15px;

}

.tool-card p {

    color: #666;

    line-height: 1.6;

}

/* ==========================
   Image to PDF — Preview Gallery (v2)
========================== */

#preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    justify-content: center;
    margin-top: 30px;
}

.preview-card {
    position: relative;
    width: 170px;
    background: #ffffff;
    border: 1px solid #eef0f6;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(20, 20, 43, .06);
    transition: transform .25s ease, box-shadow .25s ease;
}

.preview-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 32px rgba(20, 20, 43, .12);
}

.preview-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.preview-card p {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #2b2d3a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* number badge — top-left */
.image-number {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .35);
    z-index: 3;
}

/* drag handle — sits just below the number badge, not beside remove-btn */
.drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(4px);
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    font-size: 15px;
    font-weight: 700;
    color: #666;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .12);
    z-index: 2;
    transform: translateY(32px); /* pushes it below remove-btn */
}

.drag-handle:active {
    cursor: grabbing;
}

.dragging {
    opacity: .5;
    transform: translateY(32px) scale(.95);
}

/* remove button — forced to a true circle */
.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    line-height: 1;
    border: none;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, background .2s ease;
    z-index: 4;
}

.remove-btn:hover {
    transform: scale(1.15);
    background: #dc2626;
}

/* ==========================
   Counters & Info Panel
========================== */

#image-count {
    margin-top: 6px;
    color: #7a7d8c;
    font-size: 14px;
    text-align: center;
}

.pdf-info {
    max-width: 300px;
    margin: 30px auto 0;
    background: #f8f9ff;
    border: 1px solid #eef0fb;
    border-radius: 14px;
    padding: 18px 22px;
    text-align: left;
    box-shadow: 0 4px 14px rgba(20, 20, 43, .05);
}

.pdf-info h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #222;
}

.pdf-info p {
    margin: 5px 0;
    color: #555;
    font-size: 14px;
}

@media (max-width: 480px) {
    .preview-card { width: 140px; padding: 10px; }
    .preview-card img { height: 130px; }
}
/* ===========================
   PDF Loading Animation
=========================== */

#loading-box{
    display:block;
    margin-top:30px;
}

#loading-text{

    font-size:18px;

    font-weight:bold;

    margin-bottom:15px;

}

#loading-bar{

    width:100%;

    height:22px;

    background:#ddd;

    border-radius:30px;

    overflow:hidden;

}

#loading-progress{

    width:0%;

    height:100%;

    background:#2563eb;

    transition:.3s;

}

#loading-percent{

    margin-top:10px;

    font-weight:bold;

}

/* ===========================
   PDF SETTINGS
=========================== */

.pdf-settings{

    margin:30px auto;

    max-width:320px;

    background:#f8f9ff;

    padding:20px;

    border-radius:12px;

    box-shadow:0 5px 15px rgba(0,0,0,.08);

}

.pdf-settings h3{

    margin-bottom:20px;

}

.pdf-settings label{

    display:block;

    text-align:left;

    margin-top:15px;

    margin-bottom:6px;

    font-weight:bold;

}

.pdf-settings select{

    width:100%;

    padding:12px;

    border-radius:8px;

    border:1px solid #ddd;

    font-size:15px;

}