html,body{
    margin: 0;
    padding: 0;
    height: 100%;
}

.app{
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.toolbar{
    background: #1e40af;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.file-bar{
    background: #1e3a8a;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.reader{
    flex: 1;
    overflow: auto;
    background: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: start;
    padding: 1rem;
}

.reader canvas, .reader iframe{
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.toolbar button, .file-bar button, .file-bar input[type="file"]{
    flex: 1 1 120px;
    min-width: 80px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}



#viewer {
    height: 80vh;
    border: 2px solid #ccc;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: auto;
    background-color: white;
    max-width: 960px;
    min-width: 80%;
    margin: 1rem auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}



#spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
    display: none;
    font-family: sans-serif;
}

.loader {
    border: 8px solid #e0e0e0;
    border-top: 8px solid #1e40af;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.control-group{
    display: flex;
    flex-direction: row;
}

.control-group button{
    padding: 1rem;
}


.controls button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    color: white;
}

.controls button:hover {
    background: #2563eb;
}


.night-mode {
    background-color: #121212 !important;
    color: #f1f1f1 !important;
}

.night-mode * {
    color: #f1f1f1 !important;
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



@media (max-width: 600px) {
   .toolbar button, .file-bar button, .file-bar input[type="file"]{
        flex: 1 1 100%;
    }

    .reader{
        padding: 0.5rem;
    }
    
}