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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.page-info,
.zoom-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 500;
}

.pdf-viewer {
    background: #525659;
    padding: 30px;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    max-height: calc(100vh - 200px);
}

#pdf-canvas {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: white;
    display: block;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 40px;
    border-radius: 8px;
    display: none;
}

.loading.active {
    display: block;
}

/* Fallback for devices that don't support Fullscreen API (e.g. iOS) */
.container.fullscreen-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    max-width: none;
}

.container.fullscreen-fallback .pdf-viewer {
    height: calc(100% - 80px);
    /* Adjust based on header height */
    max-height: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .header {
        padding: 12px;
    }

    .header h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .controls {
        gap: 6px;
        justify-content: center;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
        flex: 0 0 auto;
    }

    .page-info,
    .zoom-info {
        padding: 8px 12px;
        font-size: 13px;
    }

    .pdf-viewer {
        padding: 10px;
        min-height: 300px;
    }

    #pdf-canvas {
        max-width: 100%;
        height: auto !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
    }

    .header {
        padding: 10px;
    }

    .header h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .controls {
        gap: 6px;
        row-gap: 8px;
    }

    .btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .page-info,
    .zoom-info {
        padding: 8px 12px;
        font-size: 13px;
    }

    .pdf-viewer {
        padding: 5px;
        min-height: 250px;
        max-height: calc(100vh - 180px);
    }

    #pdf-canvas {
        max-width: 100%;
        height: auto !important;
        width: 100% !important;
    }
}