* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(to bottom right, #c1decd, #c4dce2);
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.message {
    font-size: 1.2rem;
    color:black;
    font-weight: bold;
    margin-top: 0rem;
}

header h1 {
    color: #000;
    font-weight: bold;
    font-size: 3rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.button-group button,
.button-group label {
    background-color: #0061FF;
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, transform 0.2s;
}

.button-group button:hover,
.button-group label:hover {
    background-color: #004dc9;
    transform: scale(1.03);
}

.button-group i {
    font-size: 1.5em;
    width: 24px;
    height: 24px;
    color: white;
    object-fit: contain;
}

#my_device_input,
#drop-file-input {
    display: none;
}

.drop-area {
    background-color: #c53597;
    color: #ffffff;
    font-size: 1.7rem;
    border-radius: 10px;
    border: 2px dotted rgb(255, 255, 255);
    padding: 2rem;
    text-align: center;
    margin: 1.2rem 0;
    max-width: 700px;
    width: 100%;
    transition: background-color 0.3s;
    cursor: pointer;
    font-weight: bold;
    font-family: "Times New Roman", Times, serif;
}

.drop-area.dragover {
    background-color: #a31a78;
}

.pdf-note {
    font-size: 1rem;
    margin-top: 1.3rem;
    font-weight: bold;
    font-family: "Arial", Arial;
}

.drop-hint {
    text-align: center;
    font-size: 1.5rem;
    color: #000;
    margin-top: 0.4rem;
    font-weight: bold;
}

#canvas-area {
    display: none;
    width: 100%;
    background-color: #1a73e8;
    padding: 2rem;
    margin-top: 2rem;
    border-radius: 10px;
}

.preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

canvas {
    max-width: 100%;
    background-color: white;
    border: 2px solid #ddd;
    margin: 10px 0;
}

.page-number {
    text-align: center;
    font-weight: bold;
    margin: 1rem 0;
    color: #ffffff;
}

.file-info {
    font-weight: bold;
    margin: 1rem 0;
    color: #ffffff;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    width: 100%;
    position: relative;
}

.file-separator {
    width: 100%;
    height: 10px;
    background-color: rgb(255, 255, 255);
    margin: 2rem 0;
}

.download-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #2ecc71;
    border-radius: 10px;
    width: 100%;
    text-align: center;
    display: none;
    position: relative;
}

#pdf-list {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    margin-bottom: 1rem;
    position: relative;
}

.pdf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.9);
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}

.pdf-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.page-download-btn {
    background: #2ecc71;
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
    align-self: flex-start;
    font-weight: bold;
}

.per-page-download {
    background: #a31111;
    padding: 8px 15px;
    border-radius: 5px;
    margin: 10px 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    border: none;
}

.download-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin: 0.5rem;
    transition: background 0.3s;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.download-btn:hover {
    background-color: #2b802e;
}

.download-all {
    background-color: #75126f;
    font-weight: bold;
}

.download-all:hover {
    background-color: #2980b9;
}

.download-all-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    min-width: 120px;
    text-align: center;
    flex: 1;
}

.size-box {
    background: rgba(255,255,255,0.8);
    padding: 0.8rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    min-width: 120px;
    text-align: center;
    margin-top: 0.5rem;
    width: 100%;
}

@media (max-width: 600px) {
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button-group button,
    .button-group label {
        width: 100%;
        justify-content: center;
    }
    
    .pdf-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-box, .size-box {
        width: 100%;
    }
}
