/* =========================
   Base
========================= */

body {
    margin: 0;
    background: #eef1f7;
    overflow-x: hidden;
}

#workspaceView {
    display: none;
}

#uploadView,
#workspaceView {
    transition: all .3s ease;
}

.navbar .btn-link {
    text-decoration: none;
}

.navbar .dropdown-item.active {
    background: #dc3545;
}

/* =========================
   Shared Tool Layout
========================= */

.merge-upload-box {
    max-width: 1000px;
    margin: auto;
    background: #fff;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.drop-zone {
    min-height: 180px;
    padding: 40px 20px;
    border: 3px dashed #dc3545;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: .3s;
}

.drop-zone:hover {
    border-color: #d42d2d;
}

.drag-over,
.drag-active {
    border-color: #dc3545 !important;
    background: #fff5f5;
}

.upload-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.select-btn,
.merge-btn,
.convert-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
}

.select-btn {
    padding: 12px 35px;
}

.merge-btn {
    padding: 15px 50px;
    border-radius: 10px;
    font-size: 18px;
}

.convert-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 18px;
}

.select-btn:hover,
.merge-btn:hover,
.convert-btn:hover {
    background: #c92420;
}

.selected-files {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.file-card {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    border-radius: 8px;
}

/* =========================
   Previews
========================= */

#pdfCanvas,
.pdf-preview-canvas {
    display: block;
    width: 100%;
    max-width: 350px;
    height: auto;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.pdf-preview-grid,
.jpg-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.pdf-preview-grid {
    margin-top: 30px;
}

.pdf-preview-card,
.jpg-preview-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.pdf-preview-card {
    padding: 15px;
}

.pdf-preview-card canvas {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.pdf-preview-name,
.jpg-preview-name {
    font-size: 14px;
    word-break: break-word;
}

.pdf-preview-name {
    margin-top: 10px;
    font-weight: 600;
}

.jpg-preview-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: #f8f9fa;
}

.jpg-preview-name {
    padding: 8px;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================
   Placeholder Tools
========================= */

.tool-placeholder {
    max-width: 720px;
    background: #fff;
    border-radius: 15px;
    padding: 42px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.tool-placeholder__category {
    color: #dc3545;
    font-weight: 700;
}

/* =========================
   Auth Pages
========================= */

.auth-page {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.auth-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-card .form-control,
.auth-card .btn {
    height: 50px;
    border-radius: 10px;
}

.auth-card .btn {
    font-weight: 600;
}

/* =========================
   Footer
========================= */

.footer {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 15px 0;
    margin-top: 50px;
}

@media (max-width: 768px) {
    .merge-upload-box,
    .tool-placeholder,
    .auth-card {
        padding: 24px;
    }
}
